Hi,
I try to use cross-page postback - its not working can you find where i made the mistake?
Page One: adultreg.aspx
Created simple registration form:
<asp:TextBox ID="txtfnm" runat="server" CssClass="txtbox" Text="sen">
<asp:TextBox ID="txtlnm" runat="server" CssClass="txtbox" Text="web">
on submit button:
stored in database and
Response.Redirect("regconfirmation.aspx")
Page Two: regconfirm.aspx
Design:
<%@ PreviousPageType VirtualPath="~/adultreg.aspx" %>
<asp:Label ID="lblname" runat="server" Text=""></asp:Label>
Code:
Public Partial Class WebForm6
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
lblname.Text = "Hi "
If Not Page.PreviousPage Is Nothing Then
Dim sourcetextbox As TextBox
sourcetextbox = CType(PreviousPage.FindControl("txtfnm"), TextBox)
If Not sourcetextbox Is Nothing Then
lblname.Text = lblname.Text & UCase(sourcetextbox.Text)
End If
End If
If Not Page.PreviousPage Is Nothing Then
Dim srctextbox As TextBox
srctextbox = CType(PreviousPage.FindControl("txtlnm"), TextBox)
If Not srctextbox Is Nothing Then
lblname.Text = lblname.Text & " " & UCase(srctextbox.Text)
End If
End If
lblname.Text = lblname.Text & " , your signup is completed successfully." & vbLf & "We will get back to you shortly." & vbLf & "Thanks for registering with us."
End Sub
End Class
Result shows:
Hi , your signup is completed successfully. We will get back to you shortly. Thanks for registering with us.
Expected Result:
Hi , SEN WEB your signup is completed successfully. We will get back to you shortly. Thanks for registering with us.
Where i made the mistake ?