如何从母版页控件获取以连接aspx页 [英] how to get from master page control to contect aspx page

查看:74
本文介绍了如何从母版页控件获取以连接aspx页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人:),

我有一个问题,在我的项目中,我有一个母版页,其中有一个像linkbuton这样的控件,问题是我想获取linkbutton id来仅连接aspx代码(而不是后面的代码).如何从母版页获取控件ID ...您能帮助任何一个人吗


谢谢你,
Eshwar.V

Dear All :) ,

i Have some issue, in my project i have one master page in that one control like linkbuton, the thing is i want to get linkbutton id to contect aspx code only (not in code behind). how to get control id from master page...can u plz help any one


Thank u,
Eshwar.V

推荐答案

我相信您想问一下如何访问内容"页面中的主控件.
如果是这样,
您可以随时执行以下操作:
I believe you want to ask that how to access a master control in Content page.

If so,
you can always do something like:
LinkButton lbMaster = Master.FindControl("myLinkButton1") as LinkButton;


阅读:如何:参考ASP.NET母版页内容 [


Read: How to: Reference ASP.NET Master Page Content[^]

Now, to your second part: to get ID in Content aspx page.
Simplest would be to find the above link button in your content page load. Keep a dummy linkbutton from before in Content designer and after getting master link button assign it to the Content link button.


这篇关于如何从母版页控件获取以连接aspx页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆