上一页jquery中的隐藏字段值或从asp.net代码到jquery的隐藏字段值 [英] previous page hidden field value in jquery or from asp.net code to jquery
本文介绍了上一页jquery中的隐藏字段值或从asp.net代码到jquery的隐藏字段值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
HI
i想在当前页面中传递prevoius页面隐藏字段值
我怎么能直接得到它jquery ,,
或者
如何在asp.net中获取价值并将值从asp.net传递到jquery
请咨询
问候
maulik shah
解决方案
您必须通过QueryString
将HiddenField
值从上一页传递到下一页或者将其存储在会话
中。
所以,做以上任何一项,你可以在下一步获得它的价值页面。
把它放在你的头标签
< script type = text / javascript >
函数callit(){
var ele = document.getElementById(hiddenfield);
var x = parseInt(ele.value)+ 1;
document.getElementById(hiddenfield)。value = x;
(#<% = Label1 .ClientID %> )。text(x);
}
< / script >
放入你的正文标签
< 输入 type = hidden id = hiddenfield value = 0 / >
< < span class =code-leadattribute> asp:Label ID = Label1 runat = server Text = 你好 > < / asp:标签 >
< div < span class =code-attribute> id = MyDiv > 这是我的div < / div >
< 输入 id = Button2 type = 按钮 onclick = callit() value = 按钮 / > 跨度>
HI
i want to pass prevoius page hidden field value in current page
how can i get it directly in jquery,,
or else
how to get value in asp.net and pass value from asp.net to jquery
pls advice
regards
maulik shah
解决方案
You have to pass theHiddenField
value from previous page to the next page byQueryString
or storing that inSession
.
So, do any of the above and you can get its value in next page.
Put This in your head tag
<script type="text/javascript"> function callit() { var ele = document.getElementById("hiddenfield"); var x = parseInt(ele.value) + 1; document.getElementById("hiddenfield").value = x;
("#<%=Label1.ClientID %>").text(x); } </script>
put follwoing in your body tag
<input type="hidden" id="hiddenfield" value="0"/> <asp:Label ID="Label1" runat="server" Text="hello"></asp:Label> <div id="MyDiv">This is my div</div> <input id="Button2" type="button" onclick="callit()" value="button" />
这篇关于上一页jquery中的隐藏字段值或从asp.net代码到jquery的隐藏字段值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文