在其他母版ASP.net上查找母版下拉控件 [英] Find Master Page Dropdown control on other Master Page ASP.net
问题描述
我有两个主页面一个是User.Master而另一个是Account.Master
我想在Account.Master页面上找到User.Master下拉选择值。
请给我建议并帮助我。它们不是嵌套的主页面。
谢谢
I have two master page one is User.Master and Other is Account.Master
I want to find User.Master Dropdown selected value on Account.Master Page .
Please give me suggestion and help me. They are not nested master Page
Thanks
推荐答案
如果Account.master是User的子页面.master然后您可以通过执行以下操作找到User.master页面的控件 -
If Account.master is a child page of User.master then you can find controls of User.master page by doing something like following-
ContentPlaceHolder cp = this.Master.FindControl("ContentPlaceHolderIdOfUserMaster") as ContentPlaceHolder;
DropDownList drp = cp.FindControl("drpYourDrpId") as DropDownList ;
否则,您可以使用其他状态管理技术,例如会话,Cookies 等将值从一个独立母版页传递到另一个独立母版页。
为此,请检查这些链接 -
将页面值传输到另一页 [ ^ ]
如何:在ASP.NET Web窗体页面之间传递值
[ ^ ]
希望,它有帮助:)
Else, you can use other state management techniques like Session,Cookies etc. to pass value from one independent master page to another independent master page.
For this purpose, check these links-
Transferring page values to another page[^]
How to: Pass Values Between ASP.NET Web Forms Pages
[^]
Hope, it helps :)
这篇关于在其他母版ASP.net上查找母版下拉控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!