R
Rob Blij
Hi (sorry for repeated question)
We have ported a .NET1.1 ASP.NET app to .NET2. All our user controls have
been modified and I have found some strange behavior. Firstly I can see
that the controls now get rendered at compile time instead of declaring them
in the ascx.cs file. Then strange thing is: in our aspx page when we call
Page.LoadControl(usercontrol) all the controls within the usercontrol dont
get their unique ID ie ctl1_btnDetails etc except each repetition of the
control get ID="btnDetails" so therefore none of the events work etc.
The way I alleviated this problem is stange. After the
Page.LoadControl(usercontrol) I set:
usercontrol.NamingContainer.ID = "anythinghere" and then all the subcontrols
get ID's etc correctly.
Can someone explain this behavior?
TIA
Rob
We have ported a .NET1.1 ASP.NET app to .NET2. All our user controls have
been modified and I have found some strange behavior. Firstly I can see
that the controls now get rendered at compile time instead of declaring them
in the ascx.cs file. Then strange thing is: in our aspx page when we call
Page.LoadControl(usercontrol) all the controls within the usercontrol dont
get their unique ID ie ctl1_btnDetails etc except each repetition of the
control get ID="btnDetails" so therefore none of the events work etc.
The way I alleviated this problem is stange. After the
Page.LoadControl(usercontrol) I set:
usercontrol.NamingContainer.ID = "anythinghere" and then all the subcontrols
get ID's etc correctly.
Can someone explain this behavior?
TIA
Rob