如何在母版页上声明隐藏字段并在子页上访问它? [英] How to declare the hidden field on a master page and access it on the child pages?

查看:69
本文介绍了如何在母版页上声明隐藏字段并在子页上访问它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如问题所述,让我解释一下情况
我有一个母版页
我有一个子页面,里面有一些李的

例如:

As the Question says,Let me explain the scenario
I have a masterpage
I have a child page which has some li''s

eg:

<div class="ui-block-a btn-state"><a href="#" class="ui-btn ui-shadow ui-corner-all"  önclick="'')">Mumbai</a></div>



在此div上单击时,我想将锚点标记的内部文本保存在母版页上声明的hiddenfied值中.如何设置隐藏字段的值

我有一个3页,当单击第二页上的锚点或div时会被调用,我想获取此页上隐藏文件的值(使用代码隐藏)

如何设置隐藏字段的值,然后在后面的代码中获取该值
您能告诉我如何实现吗??也可以用Viewstate给出任何类似的解决方案.在此先感谢您.



on the click of this div I want to save the innertext of anchor tag in the hiddenfied value which was declared on master page. How to set the value of hidden field

I have a 3 page which is called when the anchor or div on the second page is clicked now I want to get the value of the hidden filed on this page(using codebehind)

How to set the value of hidden field and then fetch that value in code behind
Can you please tell me how can this be achieved.?? Also can any one give similar solution with Viewstate. Thanks in advance.

推荐答案

我正在为您提供从内容页面访问母版文本框或标签的示例.:)

I am giving you example of accessing masterpage textbox or label to from content page.. :)

Label masterlbl = (Label)Master.FindControl("lblMaster");
TextBox mastertxt = (TextBox) Master.FindControl("txtMaster");



如何从内容页面访问asp.net母版页控件 [ ^ ]

以编程方式使用ASP.NET母版页 [ ^ ]



How to access asp.net master page controls from content page[^]

Working with ASP.NET Master Pages Programmatically[^]


这篇关于如何在母版页上声明隐藏字段并在子页上访问它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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