c# - Accessing <li> tag, ASP.Net -


i'm trying access <li> tag in first master page file. tried findcontrol(..) allways returns null.

structure:

  • first master page (which contains <li id="element" runat="server">
  • second master page
  • default.aspx (need access here)

what need access li element?

you access server-side control so:

page.master.findcontrol("controlid"); 

however, if tag not set runat="server", you'll have find way, such getting resulting response.content , changing @ point.

edit: since you're using nested master pages, may need go further in control hierarchy if want reach "root" master , find control in it.

maybe: control li = page.master.master.findcontrol("controlid")


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -