访问隐藏的值. [英] Access hidden values.

查看:76
本文介绍了访问隐藏的值.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序中有一个页面,该页面分为四个框架( divs?iFrames?).我在第一帧中定义了一个隐藏变量,其ID为"fra1".我想在我的主页中访问该隐藏变量,我们在其中... (并且在这里结束).

I have a page in my application which is divided in to four frames (divs? iFrames?). I defined a hidden variable in the first frame the id of which is "fra1". I want to access this hidden variable in my main page in which we... (and it tails off here).

推荐答案

如果您想通过后面的代码访问它,然后
If you want to access it through the code-behind, then
<asp:HiddenField ID="fra1" runat="server" Value="Foo"/>


可以像访问其他任何ASP控件一样进行访问.您甚至可以更改回发的值.

如果使用JavaScript,最好的选择是使用document.getElementById(''elementId'').这是基本的JS方法之一,因此在网络上有很多参考.


can be accessed exactly like any other ASP control. You can even change the value on postbacks.

If you are using JavaScript, your best bet would be to use document.getElementById(''elementId''). This is one of the basic JS methods, so there are lots of references on the web.


这篇关于访问隐藏的值.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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