Hi there,
I have the following code on my page to try and retreive the value of a log in session variable:
<script runat="server">
Sub Page_Load (s as object, e as eventargs)
Dim objChkUsername As String
Dim edit As Integer
objChkUsername = Session("chkusername").ToS
tring()
If objChkUsername Is Nothing Then
edit = 0
Else edit = 1
End If
End Sub
</script>
I get the following error though:
[NullReferenceException: Object reference not set to an instance of an object.]
ASP.index_aspx.Page_Load(O
bject s, EventArgs e) in D:\inetpub\wwwroot\moorfie
ldsresearc
h.org.uk\p
rocess\ind
ex.aspx:6
System.Web.UI.Control.OnLo
ad(EventAr
gs e) +67
System.Web.UI.Control.Load
Recursive(
) +35
System.Web.UI.Page.Process
RequestMai
n() +750
Can anyone suggest where i am going wrong as i am new to asp.net and can't find any simple enough information on the net!
Thanks,
Richard
Start Free Trial