<asp:Login ID="Login1" runat="server" RememberMeSet="true" DisplayRememberMe="true" VisibleWhenLoggedIn= “false” >
</asp:Login>Protected Sub Login1_LoggedIn(ByVal sender As Object, ByVal e As System.EventArgs) Handles Login1.LoggedIn
Dim user As MembershipUser = Membership.GetUser(Login1.UserName)
Dim cookie As New HttpCookie("someName")
cookie.Values.Add("userName", user.UserName)
cookie.Values.Add("password", user.GetPassword)
Response.Cookies.Add(cookie)
End SubIf Not HttpContext.Current.Request.IsAuthenticated Then
If Request.Cookies("someName") IsNot Nothing Then
Dim userName As String = Request.Cookies("someName")("userName")
Dim password As String = Request.Cookies("someName")("password")
Dim userNameTxt As TextBox = CType(Login1.FindControl("UserName"), TextBox)
Dim passwordTxt As TextBox = CType(Login1.FindControl("Password"), TextBox)
userNameTxt.Text = userName
passwordTxt.Text = password
End If
End If
Utilizadores a navegar neste fórum: Nenhum utilizador registado e 1 visitante