Home » 2012 » March

Archive for March, 2012

VB.NET – Login form – create user session

This post will guide you through designing the login form with SQL backend and creating a user session. Learn more about new promotions! login.aspx login.aspx (markup code) <%@ Page Title=”” Language=”VB” MasterPageFile=”~/Default.Master” AutoEventWireup=”false” CodeFile=”login.aspx.vb” Inherits=”_login” %> <asp:Content ID=”HeaderContent” runat=”server” ContentPlaceHolderID=”HeadContent”> </asp:Content> <asp:Content ID=”BodyContent” runat=”server” ContentPlaceHolderID=”MainContent” > <table border=”0″ cellpadding=”1″ cellspacing=”0″> <tr> <td colspan=”2″>Login:</td> </tr> <tr> […]

VB.NET – End user session

To end user session and disable user from using a back button to go back to secure page, you need two pages i simply named killsession.aspx and logout.aspx. I will explain both pages with code behind and markup code. killsession.aspx killsession.aspx (markup code) < !DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml”> <head […]

VB.NET – passing string value from code behind to markup on the page

Solution 1 Protected doit As String = “Hello” (in .vb file) < %=Me.doit%> (inside the markup) Solution 2 ‘automatic properties Protected Property doit2 As String = “Hello” (in .vb file) < %=doit2%> (inside the markup) ‘no automatic properties Private _doit3 As String (in .vb file) Protected Property doit3 As String Get Return _doit3 End Get […]