c#中的母版页ID调用问题 [英] master page id calling issue in c#
本文介绍了c#中的母版页ID调用问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
unorder list(ul)我需要如何在子页面中调用那个ul id
unorder list(ul) in master page i need to how to call that ul id in child pages
推荐答案
您可以像下面这样使用。
在主页:
Hi,
You can use like the following.
In the masterpage:
<ul runat="server" id="list">
<li runat="server" id="home">Home</li>
<li runat="server" id="news">News</li>
</ul>
在子页面中:
In the child page:
Control list = this.Page.Master.FindControl("list");
谢谢
Thanks
您可以使用代码wherw'ul1'是您在母版页中找到的控件名称。
You can use the code wherw 'ul1' is the your control name that your finding in your master page.
Page.Master.FindControl("ul1");
谢谢,
Mamun
Thanks,
Mamun
这篇关于c#中的母版页ID调用问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文