G
Guest
Hi, I am getting a strange error. Last night when I left work this was
working perfectly. This morning when I try to run this code in VS2005, it
comes up with an error saying "The name 'UserName' does not exist in the
current context". I don't know what to do about it. The field is there. It
worked yesterday. Any ideas?
HTML CODE:
<%@ Master Language="C#" EnableTheming="false"
AutoEventWireup="true" CodeFile="mp_Main.master.cs" Inherits="mp_Main" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>My Page</title>
<link rel="stylesheet" type="text/css" href="CSS/g-styles.css" />
</head>
<body>
<form id="frmMain" runat="server">
<asp:SiteMapDataSource ID="dsMySiteMap" runat="server"
ShowStartingNode="False" SiteMapProvider="MainMapProvider" />
<div id="g-wrapper">
<div id="h-wrapper">
<div id="h-head">
<div class="l-area">
<div class="l-column">
<div class="f-label">user name</div>
<div class="r-field" id="Div1">
<div class="f-field-left"></div>
<div class="f-field-center">
<asp:TextBox ID="UserName" runat="server"
CssClass="f-field"></asp:TextBox>
</div>
<div class="f-field-right"></div>
</div>
etc...
CODE BEHIND:
....
protected void btnLogin_Click(object sender, EventArgs e)
{
string sError = "";
if (UserName.Text == "")
{
sError = "True";
}
etc...
Thanks,
Michael
working perfectly. This morning when I try to run this code in VS2005, it
comes up with an error saying "The name 'UserName' does not exist in the
current context". I don't know what to do about it. The field is there. It
worked yesterday. Any ideas?
HTML CODE:
<%@ Master Language="C#" EnableTheming="false"
AutoEventWireup="true" CodeFile="mp_Main.master.cs" Inherits="mp_Main" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>My Page</title>
<link rel="stylesheet" type="text/css" href="CSS/g-styles.css" />
</head>
<body>
<form id="frmMain" runat="server">
<asp:SiteMapDataSource ID="dsMySiteMap" runat="server"
ShowStartingNode="False" SiteMapProvider="MainMapProvider" />
<div id="g-wrapper">
<div id="h-wrapper">
<div id="h-head">
<div class="l-area">
<div class="l-column">
<div class="f-label">user name</div>
<div class="r-field" id="Div1">
<div class="f-field-left"></div>
<div class="f-field-center">
<asp:TextBox ID="UserName" runat="server"
CssClass="f-field"></asp:TextBox>
</div>
<div class="f-field-right"></div>
</div>
etc...
CODE BEHIND:
....
protected void btnLogin_Click(object sender, EventArgs e)
{
string sError = "";
if (UserName.Text == "")
{
sError = "True";
}
etc...
Thanks,
Michael