Author: dba123 | Posted on: 12/10/2009 12:26:30 AM | Views : 468

I'm trying to get reference to a <ul> that resides in a user control of my .aspx from my .aspx.cs but when I try to gain reference it's null
So this is in my .ascx:
<ul id="notificationsList" runat="server"></ul>
In my .asxp I have a reference to that user control:
<pmc:MyControl id="myControlReference" runat="server" EnableViewState="false" />
and in the code-behind of the .aspx page which is using that user control I have:

HtmlGenericControl notificationListControl = MyControlReference.FindControl("notificationList") as HtmlGenericControl;
but notificationListControl ends up null when one of my methods which contains this is called after the user clicks a button on the .aspx page that calls the method that invokes that code in my code-behind class of the .aspx

...

Go to the complete details ...