I have the following HiddenField in my ASP.NET 2.0 webform:
<asp:HiddenField ID="HiddenModel" runat="server"
OnValueChanged="HiddenModel_ValueChanged" />
My codebehind references HiddenModel in this if..else statement:
if (serial.Text.ToString() != "0")
{
CarpetMultiView.ActiveViewIndex = 1;
HiddenModel.Value = model.SelectedItem.Text.ToString();
LabelCurrent.Text = "Your Current Selection is :
Make-" + make.SelectedItem.Text.ToString() + " Model-" +
model.SelectedItem.Text.ToString() + " S/N-" + serial.SelectedItem.Text.ToString();
Page.Title = make.SelectedItem.ToString() + " " + model.SelectedItem.ToString() + " " +
serial.SelectedItem.ToString() + " " + "Carpet";
}
When I debug the solution using VWD 2005, I receive the following error:
The name 'HiddenModel' does not exist in the current context
My @Page directive inherits carpet_template which matches the codebehind class:
public partial class carpet_template : System.Web.UI.Page
How can I resolve these and other similar errors?
From the link below: "If you are testing in IIS, you should go to the website menu in VWD, click start options, click "build" on the tree in the left pane, and on the dropdown list labelled "Before running startup page" select "No Build".
Full story HERE.