E
ericw3
I am switching from Java to the .Net framework.
In order to separate page layout design from the application code, I
studied the codebehind tutorial by John at
http://www.asp101.com/articles/john/codebehindnovs/default.asp
In my GetQueryResult.aspx, I defined a DataGrid as follows:
<asp
ataGrid ID ="dgQueryResults" runat="server"
AllowPaging="True"
PageSize="20"
PagerStyle-Mode="NumericPages"
PagerStyle-HorizontalAlign="Right"
OnPageIndexChanged="dgQueryResult_Page"
BorderColor="black"
BorderWidth="1"
GridLines="Both"
CellPadding="3"
CellSpacing="0"
HeaderStyle-BackColor="#aaaadd"
AlternatingItemStyle-BackColor="#eeeeee" />
And in a VB file separate from GetQueryResult.aspx, I have:
Public Class QueryResult
Sub dgQueryResult_Page(sender As System.Object, _
e As
System.Web.UI.WebControls.DataGridPageChangedEventArgs)
dgQueryResults.CurrentPageIndex = e.NewPageIndex
Call BindData(dgQueryResults)
End Sub
Sub BindData(dgDataGrid As System.Web.UI.WebControls.DataGrid)
'// I defined BindData Sub here and it works great.
End Sub
End Class
But, when I check out the GetQueryResult.aspx page from the browser, I
get the following error message:
Compiler Error Message: BC30456: 'dgQueryResult_Page' is not a member
of 'ASP.query_results_aspx'.
I don't understand this. I do have dgQueryResult_Page defined in the
class. Any idea about what is going on? Thanks.
In order to separate page layout design from the application code, I
studied the codebehind tutorial by John at
http://www.asp101.com/articles/john/codebehindnovs/default.asp
In my GetQueryResult.aspx, I defined a DataGrid as follows:
<asp
AllowPaging="True"
PageSize="20"
PagerStyle-Mode="NumericPages"
PagerStyle-HorizontalAlign="Right"
OnPageIndexChanged="dgQueryResult_Page"
BorderColor="black"
BorderWidth="1"
GridLines="Both"
CellPadding="3"
CellSpacing="0"
HeaderStyle-BackColor="#aaaadd"
AlternatingItemStyle-BackColor="#eeeeee" />
And in a VB file separate from GetQueryResult.aspx, I have:
Public Class QueryResult
Sub dgQueryResult_Page(sender As System.Object, _
e As
System.Web.UI.WebControls.DataGridPageChangedEventArgs)
dgQueryResults.CurrentPageIndex = e.NewPageIndex
Call BindData(dgQueryResults)
End Sub
Sub BindData(dgDataGrid As System.Web.UI.WebControls.DataGrid)
'// I defined BindData Sub here and it works great.
End Sub
End Class
But, when I check out the GetQueryResult.aspx page from the browser, I
get the following error message:
Compiler Error Message: BC30456: 'dgQueryResult_Page' is not a member
of 'ASP.query_results_aspx'.
I don't understand this. I do have dgQueryResult_Page defined in the
class. Any idea about what is going on? Thanks.