bozworthy
asked on
New ASP control not accessible in code behind
Sometimes when I add a new control in ASP it isn't accessible in the codebehind until I completely exit the website and reopen it in Visual Studio 2005.
Here's the latest one:
<asp:ListBox ID="lbStatus" Height="85px" Width="410px" AutoPostBack="false" CausesValidation="false" runat="server" Visible="true"></asp:ListB ox>
It is not available in the list of objects in codebehind. And when I do "Me.lbStatus" it says it's not a member of my form.
I saved, did a Refresh from the Solution explorer, did a right-click -> refresh on the project name. Nothing works. What's up with this?
Here's the latest one:
<asp:ListBox ID="lbStatus" Height="85px" Width="410px" AutoPostBack="false" CausesValidation="false" runat="server" Visible="true"></asp:ListB
It is not available in the list of objects in codebehind. And when I do "Me.lbStatus" it says it's not a member of my form.
I saved, did a Refresh from the Solution explorer, did a right-click -> refresh on the project name. Nothing works. What's up with this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The wireup trick worked. That's a reasonable workaround as opposed to closing/opening the entire folder.
ASKER
Actually, just inserting or deleting a blank line in the aspx page works too.
Interesting...I guess if I just make it a habit to return after creating a control, this should happen anymore.
Thanks for the shorter workaround!
Thanks for the shorter workaround!
Regards,
Max.