I have two webpage in my website namely Default.aspx and Default2.aspx
I have asp.net textbox1 and button1 inside Form tag in Default.aspx page
and开发者_如何学Go i have textbox1 inside form tag in Default2.aspx page
i want when i wanna transfer the textbox1 text of default.aspx page into default2.aspx textbox1 text hidden parameters ... which will not show query string in address bar and transfer value from one page to another..
how to do this ...
use PreviousPage.FindControl
You can use something called Cross-Page Posting . Look at the example Here
If Not Page.PreviousPage Is Nothing Then
Dim SourceTextBox As TextBox
SourceTextBox = CType(PreviousPage.FindControl("TextBox1"), _
TextBox)
If Not SourceTextBox Is Nothing Then
Label1.Text = SourceTextBox.Text
End If
End If
Make Sure you post back to Different page like this:
<asp:Button ID="Button1" PostBackUrl="~/TargetPage.aspx" runat="server" Text="Submit" />
精彩评论