I have two aspx pages the first page has a textbox and the second aspx page has one textbox
In the second Page I am giving value to the text box by generating a session and giving that session ID to the textbox on the samepage
Now I need to retrieve back that session ID from the textbox and display it in first aspx page textbox which is not happening and not getting any error.
Here is my code for the first aspx page:
<asp:TextBox ID="CopySession" runat="server"></asp:TextBox>
This is my code for displaying the retrieved Session ID:
If IsPostBack Then
Dim text1 As TextBox = Me.PreviousPage.FindControl("SessionValue")
CopySession.Text = text1.Text
End If
This is my second aspx page:
<asp:TextBox ID="SessionValue" runat="server"></asp:TextBox>
This is my code behind for second aspx page:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Session("ID") Is Nothing Then
Session("ID") = Guid.NewGuid.ToString
SessionValue.Text = Session("ID")
End If
End Sub