在asp.net中找到html控件 [英] find html control in asp.net
本文介绍了在asp.net中找到html控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<li id="liInvoiceYetToBeRaisedReport" runat="server" visible="false"><ahref style="background: removed(Images/strip.png) repeat-y;">
我在母版页中有此标签
现在我想找到"liInvoiceYetToBeRaisedReport".
我尝试使用此代码进行查找,但没有成功
i have this tags in masterpage
now i want to find "liInvoiceYetToBeRaisedReport".
i tried this code for finding but it didn''t work
HtmlGenericControl lt = (HtmlGenericControl)Master.FindControl("liInvoiceYetToBeRaisedReport");
请给我一个解决方案.
kindly give me a solution.
推荐答案
您不需要查找控件
您将使用id直接在aspx.cs页面中访问此控件
you don''t need to find control
you will directly access this control in aspx.cs page using id
请参阅以下CP文章中的如何与内容页面中的母版页控件进行交互"部分,
内部母版页 [
Refer to the section "How to interact with master page controls from content page" in the below CP article,
Inside Master Pages[^]
Hope it helps.
这篇关于在asp.net中找到html控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文