G
Guest
Hi all,
I have an event in user control email to handling email change when user
want to change the input for email address. Here it is
In email.ascx.vb:
Protected Sub UpdateEmail(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TxtEmail.TextChanged
If Session("Email") <> Me.Email Then
Session("Email") = TxtEmail.Text 'or me.email
End If
End Sub
In email.ascx, I have
<asp:TextBox id="TxtEmail" OnTextChanged="UpdateEmail" runat="server"
changed for the email address.
But his event doesn't fire after I made the change in the text box until I
click the continue button on the page. The update session variable doesn't
work. I don't know why.
And I have to add the some code in the page containing the email user
control to make the update working. But it doesn't make any sense to me to
have event handler. here it is:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Session("Email") <> "" Then
If Email.Email <> Session("Email") Then
Session("Email") = Email.Email
Else
Email.Email = Session("Email")
End If
End If
End Sub
I have an event in user control email to handling email change when user
want to change the input for email address. Here it is
In email.ascx.vb:
Protected Sub UpdateEmail(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TxtEmail.TextChanged
If Session("Email") <> Me.Email Then
Session("Email") = TxtEmail.Text 'or me.email
End If
End Sub
In email.ascx, I have
<asp:TextBox id="TxtEmail" OnTextChanged="UpdateEmail" runat="server"
My purpose is to update session variable if there is anything has been</asp:TextBox>
changed for the email address.
But his event doesn't fire after I made the change in the text box until I
click the continue button on the page. The update session variable doesn't
work. I don't know why.
And I have to add the some code in the page containing the email user
control to make the update working. But it doesn't make any sense to me to
have event handler. here it is:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Session("Email") <> "" Then
If Email.Email <> Session("Email") Then
Session("Email") = Email.Email
Else
Email.Email = Session("Email")
End If
End If
End Sub