jennifercheng2008
Programmer
I spend hours today in this problem:
It looks the controls are hidden during compile.
In the c# code, I can see the controls. When I write "this.", the controls can show in the popup window.
But compile the code, I got error message "_Default' does not contain a definition for 'UserNameTextBox'".
It happened to other controls. Why these controls are hidden by VS2005? Any idea to avoid this problem?
My aspx code here:
<%@ Page
Language="C#"
MasterPageFile="PageMaster.Master"
AutoEventWireup="true"
CodeFile="Default.aspx.cs"
Inherits="_Default" %>
...
<asp:TextBox ID="UserNameTextBox" runat="server" >
...
C# code here:
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
String test3 = this.UserNameTextBox.Text;
}
}
By the way, when I right click "UserNameTextBox" and select "go to definition", get error message "the definition of the object is hidden"
Thanks very much.
Jennifer
It looks the controls are hidden during compile.
In the c# code, I can see the controls. When I write "this.", the controls can show in the popup window.
But compile the code, I got error message "_Default' does not contain a definition for 'UserNameTextBox'".
It happened to other controls. Why these controls are hidden by VS2005? Any idea to avoid this problem?
My aspx code here:
<%@ Page
Language="C#"
MasterPageFile="PageMaster.Master"
AutoEventWireup="true"
CodeFile="Default.aspx.cs"
Inherits="_Default" %>
...
<asp:TextBox ID="UserNameTextBox" runat="server" >
...
C# code here:
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
String test3 = this.UserNameTextBox.Text;
}
}
By the way, when I right click "UserNameTextBox" and select "go to definition", get error message "the definition of the object is hidden"
Thanks very much.
Jennifer