I have an aspx page that I am trying to bind to a method in a BL class I have--but the binding can't recognize the class--even when I include it in the code-behind page. I basically had to create a method in the code behind page that called the class. Here is the code that works:
<%@ Page Language="
VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="awards.aspx.
vb" Inherits="awards" title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<div style="position:relative; min-height:500px;" >
<div style="position:absolute; top:0; bottom:0; left:0; margin-left:5px; margin-top:5px;">
<asp:Image ID="Image1" runat="server" ImageUrl="Site_Images/YosemiteFalls.jpg" Width="400px"/>
</div>
<div style="margin: 5px 5px 5px 440px; min-height:720px; padding-top:4px">
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataSourceID="GetLocationsDataSource" AllowPaging="True" GridLines="None" HorizontalAlign="NotSet" EditRowStyle-VerticalAlign="NotSet" ShowHeader="false" PageSize="10" DataKeyNames="awardID">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LocationLabel1" runat="server" Text='<%# Eval("Location") %>' Font-Bold="true"></asp:Label>
<asp:GridView ID="GridView1" AutoGenerateColumns="False" runat="server" DataSource='<%# BehindGetPlaceListPerAward(CType(Eval("AwardID"), Integer)) %>' GridLines="None" ShowHeader="false">
<Columns>
<asp:BoundField DataField="year" DataFormatString="{0}:" />
</Columns>
<Columns>
<asp:BoundField DataField="title" />
</Columns>
</asp:GridView>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle VerticalAlign="Top" />
</asp:GridView>
</div>
</div>
<asp:ObjectDataSource ID="GetLocationsDataSource" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetList" TypeName="Searing.SunArtSite.Bll.AwardsManager"></asp:ObjectDataSource>
</asp:Content>
Here's the code behind page:
Imports Searing.SunArtSite.BO
Imports Searing.SunArtSite.Bll
Partial Class awards
Inherits System.Web.UI.Page
Protected Function BehindGetPlaceListPerAward(ByVal id As Integer) As PlaceList
Return PlaceManager.GetPlaceListPerAward(id)
End Function
End Class
Why couldn't I just call PlaceManager.GetPlaceListPerAward(id) directly from the aspx page rather than calling BehindGetPlaceListPerAward(id) to only have it do it.
Basically..why does the code-behind page see the method in the class PlaceManager (Namespace rsearing.sunartsite.BLL) but the "front-side" aspx page can't see it?
Thanks,
Rob