Hi,
I'm trying to code a search page in VB.NET that will accept a bunch of values and then display the findings on a separate results page.
I'm using server.transfer in the search page to navigate to the results page. On the results page in the .aspx I have this code under the page directive:
In the page load event I have this code that I'm just using to test if data is being passed correctly or not:
When I run this I get this error:
This is my declaration of the textbox:
Nowhere have I declared the textbox public or protected or anything so how do I correct this?
Many Thanks,
- VB Rookie
I'm trying to code a search page in VB.NET that will accept a bunch of values and then display the findings on a separate results page.
I'm using server.transfer in the search page to navigate to the results page. On the results page in the .aspx I have this code under the page directive:
Code:
<%@ Reference Page="StudentFind.aspx" %>
In the page load event I have this code that I'm just using to test if data is being passed correctly or not:
Code:
Dim searchPage As StudentFind
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Response.write(searchPage.txtFName.Text)
End Sub
When I run this I get this error:
Code:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30390: 'StudentFind.Protected Dim WithEvents txtFName As System.Web.UI.WebControls.TextBox' is not accessible in this context because it is 'Protected'.
Source Error:
Line 9: '---------------------------------------------------------------------------------
Line 10: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Line 11: Response.write(searchPage.txtFName.Text)
Line 12:
Line 13: End Sub
This is my declaration of the textbox:
Code:
<td><asp:TextBox CssClass="style_1" ID="txtFName" runat="server" /></td>
Nowhere have I declared the textbox public or protected or anything so how do I correct this?
Many Thanks,
- VB Rookie