如何将值从一个页面传递到其他客户端脚本
问题描述:
伙计们有一组控件完全是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