Error - "'Control' is not a member of 'form'."

Hi

 I have not worked in ASP.NET for quite a few months now... and it really shows.

Desinging new simple site - nicked some of my old code. I think I must have totally forgotten a few crucial bits here and there. Code below:

<%@ Page Language="VB" AutoEventWireup="false" MasterPageFile="~/change_master.master" 
MaintainScrollPositionOnPostBack ="true" %>


<asp:Content ID="mycontent" ContentPlaceHolderID="master_placeholder" Runat="Server">

    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

</asp:Content>
  
Imports system.Diagnostics

Partial Class exp_slave
    Inherits System.Web.UI.Page

    Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Debug.Print(Me.textbox1.visible)

    End Sub

End Class

 elicits following error:

"'textbox1' is not a member of 'exp_slave'."

I think it has something to do with the master page. Please let me know what I am doing wrong and go easy on me

 

Ta Big Smile

0
pootle_flump
2/8/2007 5:43:15 PM
asp.net.getting-started 91979 articles. 4 followers. Follow

1 Replies
880 Views

Similar Articles

[PageSpeed] 20

I'm assuming exp_slave is the code-behind for the content page code you pasted?

You're missing the CodeFile and Inherits attribute, which tell the aspx page which code file to look at and which class to use. If your aspx page is named "exp_slave.aspx", you need to change your Content Page tag to:

<%@ Page Language="VB" AutoEventWireup="false" MasterPageFile="~/change_master.master" 
MaintainScrollPositionOnPostBack ="true" CodeFile="exp_slave.aspx.vb" Inherits="exp_slave" %>

 

This should have been generated if you created the page within Visual Studio..


---------------------------------------
MCP - Web Based Client Development .NET 2.0
0
ps2goat
2/8/2007 8:07:51 PM
Reply: