~ Simple login application ~ Web.config <system.web> <authentication mode=”Forms”> <forms loginUrl=”~/ Login.aspx” timeout=”2880″/> </authentication> </system.web> Login.aspx <asp:Label ID=”UserNameLabel” runat=”server” AssociatedControlID=”UserName”>User Name:</asp:Label> <asp:TextBox ID=”UserName” runat=”server”></asp:TextBox> <asp:RequiredFieldValidator ID=”UserNameRequired” runat=”server” ControlToValidate=”UserName” ErrorMessage=”User Name is required.” ToolTip=”User Name is required.” ValidationGroup=”Login1″>* </asp:RequiredFieldValidator> <asp:Label ID=”PasswordLabel” runat=”server” AssociatedControlID=”Password”>Password:</asp:Label> <asp:TextBox ID=”Password” runat=”server” TextMode=”Password”></asp:TextBox> <asp:RequiredFieldValidator ID=”PasswordRequired” runat=”server” ControlToValidate=”Password” ErrorMessage=”Password is required.” ToolTip=”Password is […]
Archive for the 'ASP.NET' Category
VB.NET – add record in code behind
MyForm.aspx <asp:TextBox ID=”AddRec” runat=”server”> </asp:TextBox> <asp:Button ID=”AddBtn” runat=”server” Text=”Add” /> <asp:Label ID=”LblMsg” runat=”server”> </asp:Label> MyForm.aspx.vb Protected Sub AddBtn_Click(sender As Object, e As System.EventArgs) Handles AddBtn.Click Dim NewRec As TextBox ‘binding controls NewRec = AddBtn.FindControl(“AddRec”) If NewLoc.Text.ToString() “” Then ‘/ access db connection – ‘/ MS Access 2007/10 driver * you can define your own sql […]