Det må du da gerne det kommer her :
#################################################
Imports try2try.LoginBiz
Imports try2try.Util
Public Class Login
Inherits System.Web.UI.UserControl
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents vld_Password As System.Web.UI.WebControls.RequiredFieldValidator
Protected WithEvents lbl_Username As System.Web.UI.WebControls.Label
Protected WithEvents txt_Username As System.Web.UI.WebControls.TextBox
Protected WithEvents vld_Username As System.Web.UI.WebControls.RequiredFieldValidator
Protected WithEvents lbl_Password As System.Web.UI.WebControls.Label
Protected WithEvents txt_Password As System.Web.UI.WebControls.TextBox
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents btn_Login As System.Web.UI.WebControls.LinkButton
Protected WithEvents btn_LostPassword As System.Web.UI.WebControls.LinkButton
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = Session("Test")
DataBind()
End Sub
Private Sub btn_Login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Login.Click
If Page.IsValid Then
If CheckLogin(txt_Username.Text, cls_Function.GenerateHash(txt_Password.Text)) Then
Session("test") = "Du er nu logget ind :o) - " & Session("UserId")
Else
Session("test") = "Du blev IKKE logget ind :o( - " & Session("UserId")
End If
Response.Redirect("Default.aspx")
End If
End Sub
Private Sub btn_LostPassword_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_LostPassword.Click
Response.Redirect("?m=lostpassword")
End Sub
End Class
##############################################################
Og fra selve design view :
##############################################################
<%@ Control Language="vb" AutoEventWireup="false" Codebehind="Login.ascx.vb" Inherits="try2try.Login" TargetSchema="
http://schemas.microsoft.com/intellisense/ie5" %>
<P><asp:label id="lbl_Username" runat="server" Text='<%# GetLocalizedString("username") %>'></asp:label><BR>
<asp:textbox id="txt_Username" runat="server" CssClass="textbox"></asp:textbox><asp:requiredfieldvalidator id=vld_Username runat="server" ErrorMessage='<%# GetLocalizedString("vld_username") %>' ControlToValidate="txt_Username">
</asp:requiredfieldvalidator><BR>
<BR>
<asp:label id="lbl_Password" runat="server" Text='<%# GetLocalizedString("password") %>'></asp:label><BR>
<asp:textbox id="txt_Password" runat="server" TextMode="Password" CssClass="textbox"></asp:textbox><asp:requiredfieldvalidator id=vld_Password runat="server" ErrorMessage='<%# GetLocalizedString("vld_password")%>' ControlToValidate="txt_Password">
</asp:requiredfieldvalidator><BR>
<BR>
<asp:linkbutton id=btn_Login runat="server" Text='<%# GetLocalizedString("login")%>'>
</asp:linkbutton> |
<asp:linkbutton id=btn_LostPassword runat="server" Text='<%# GetLocalizedString("lostpassword")%>' CausesValidation="False">
</asp:linkbutton></P>
<P><asp:label id="Label1" runat="server"></asp:label></P>
Så har du lidt at kigge på :o)