|
-
August 18th, 2011, 12:28 PM
#1
Out of context Problem
Hello,
I seem to have a lack of understanding here and need some help.
When I try and compile this in MS Visual Web Developer 2010 I am getting this error
Error 5 The name 'DropDown1' does not exist in the current context
I do not understand why this happening.
Could someone please explain why this would be happening.
Thanks
Mike
if (!LabelIsDone)
{
DropDownListText = "";
LabelIsDone = true;
CtrlNbr++;
DropDownListId = "List1" ;
DropDownList DropDown1 = new DropDownList();
DropDown1.ID = DropDownListId; DropDown1.Width = 255;
DropDown1.Items.Add("TEST ENTRY");
this.PlaceHolder1.Controls.Add(DropDown1);
else
{
DropDown1.Items.Add("ENTRY 2);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|