运行时如何在母版页中获取Asp控件的ID或文本 [英] Runtime How to get the Id or Text of Asp controls in Masterpage
本文介绍了运行时如何在母版页中获取Asp控件的ID或文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
朋友,...
我在Web应用程序中使用C#在asp.net中具有母版页...
我需要使几个链接按钮不可见,所以我需要获取该主页中所有链接按钮的ID或Text值...
是否可以在C#代码/Java脚本/J查询中获取ID或文本
请帮帮我....
在此先感谢...
Hi Friends,...
I have web application with master page in asp.net using C#...
i need to make invisible few link buttons, So i need to get the Id or the Text value of the all link buttons in that master page...
is it possible to get the Id or Text in C# code / Java Script / J query
Please Help me....
Thanks in advance ...
推荐答案
通过此链接
母版页和内容页的交互
Go through this link
Master Page and Content Page Interaction
TextBox TextBox1 = (TextBox)ContentPlaceHolder1.FindControl("TextBox1");
if (TextBox1 != null)
{
Label1.Text = TextBox1.Text;
}
假设在您的母版页中有一个链接按钮
Suppose In your Master page there is a linkbutton
<asp:linkbutton id="LinkButton1" runat="server" xmlns:asp="#unknown">LinkButton</asp:linkbutton>
在您的母版页代码后面写
In your Master page code behind write
LinkButton1.Visible = false;
这篇关于运行时如何在母版页中获取Asp控件的ID或文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文