如何将值从一个页面传递到其他客户端脚本 [英] How Do I Pass Values From One Page To Other Client Side Script

查看:60
本文介绍了如何将值从一个页面传递到其他客户端脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们有一组控件完全是html。所以我想将一个文本框的值提取到其他页面的文本框中。



i不想使用会话..



例如

sample1.aspx



< body>

< form id =form1runat =server>

guys ive a set of controls which are completely in html. so i want to fetch the value of the one textbox to other page's textbox.

i dont wanna use sessions ..

eg
sample1.aspx

<body>
<form id="form1" runat="server">





< asp:TextBox ID =txtDatarunat =server>

< input id = txtData1type =textrunat =server/>





< asp:按钮ID =btnHttpPostrunat = serverText =HTTPPostPostBackUrl =〜/ WebForm2.aspx/>



<asp:TextBox ID="txtData" runat="server">
<input id="txtData1" type="text" runat="server" />



<asp:Button ID="btnHttpPost" runat="server" Text="HTTPPost" PostBackUrl="~/WebForm2.aspx" />



< / form>

< / body>





sample2.aspx





< body>

< form id =form1runat =server>


</form>
</body>


sample2.aspx


<body>
<form id="form1" runat="server">







数据为:<%= Request.Form [txtData]%>< asp:Label ID =Label1runat =serverText =Label>



< input type =textid =k/>

La bel1 =<%= Request.Form [txtData1]%>




Data is: <%=Request.Form["txtData"] %><asp:Label ID="Label1" runat="server" Text="Label">

<input type="text" id="k" />
Label1= <%=Request.Form["txtData1"] %>



< / form>

< / body>







所以我想从sample1.aspx发送值id = txtData到sample2.aspx(文本框id =k)


</form>
</body>



so i wanna send values id=txtData from sample1.aspx to sample2.aspx (text box id="k")

推荐答案

<input type="text" id="k" value="<%= Request.Form["txtData"] %>" />


使用会话变量或通过URL传递它。

参考



http://msdn.microsoft.com/en-us/library/6c3yckfw(v = vs.100).aspx [ ^ ]



http://www.nullskull.com/a/10400710/eight-different-ways-to-transfer-data-from-one-page-to-another-page.aspx [ ^ ]



谢谢
use Session Variable or pass it through URL.
Refer

http://msdn.microsoft.com/en-us/library/6c3yckfw(v=vs.100).aspx[^]

http://www.nullskull.com/a/10400710/eight-different-ways-to-transfer-data-from-one-page-to-another-page.aspx[^]

Thanks


这篇关于如何将值从一个页面传递到其他客户端脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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