L
lalitha1024
Hi,
In my Asp.net project when i am login to my site, i'll set th
cookies by using below commands.
Dim IdCookie As New HttpCookie("empid"
ds.Tables(0).Rows(0).Item(0))
Dim FnameCookie As New HttpCookie("empname"
ds.Tables(0).Rows(0).Item(1))
Response.Cookies.Add(IdCookie)
Response.Cookies.Add(FnameCookie)
In each and every page i wrote authorization by using belo
statements.
If Request.Cookies("empid").Value = "" Then
Response.Write("<b> You are not authorised to view thi
page...</b>")
Server.Transfer("employerlogin.aspx")
End If
when i am trying to execute pages separetely in browser i am gettin
below error. i am copying here my total error page.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution o
the current web request. Please review the stack trace for mor
information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference no
set to an instance of an object.
Source Error:
Line 24: Private Sub Page_Load(ByVal sender As System.Object, ByVa
e As System.EventArgs) Handles MyBase.Load
Line 25: Dim id As String
Line 26: id = Request.Cookies("empid").Value
Line 27: 'If CType(Response.Cookies("empid").Value, String)
"" Then
Line 28:
Source File: c:\inetpub\wwwroot\Gotsap\emphome.aspx.vb Line: 26
Stack Trace:
[NullReferenceException: Object reference not set to an instance of a
object.]
Gotsap.emphome.Page_Load(Object sender, EventArgs e) i
c:\inetpub\wwwroot\Gotsap\emphome.aspx.vb:26
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573
ASP.NET Version:1.1.4322.573
What is the error, i am not able to understand.
Plz help me out.
Thanks in advance.
Lalitha.
In my Asp.net project when i am login to my site, i'll set th
cookies by using below commands.
Dim IdCookie As New HttpCookie("empid"
ds.Tables(0).Rows(0).Item(0))
Dim FnameCookie As New HttpCookie("empname"
ds.Tables(0).Rows(0).Item(1))
Response.Cookies.Add(IdCookie)
Response.Cookies.Add(FnameCookie)
In each and every page i wrote authorization by using belo
statements.
If Request.Cookies("empid").Value = "" Then
Response.Write("<b> You are not authorised to view thi
page...</b>")
Server.Transfer("employerlogin.aspx")
End If
when i am trying to execute pages separetely in browser i am gettin
below error. i am copying here my total error page.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution o
the current web request. Please review the stack trace for mor
information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference no
set to an instance of an object.
Source Error:
Line 24: Private Sub Page_Load(ByVal sender As System.Object, ByVa
e As System.EventArgs) Handles MyBase.Load
Line 25: Dim id As String
Line 26: id = Request.Cookies("empid").Value
Line 27: 'If CType(Response.Cookies("empid").Value, String)
"" Then
Line 28:
Source File: c:\inetpub\wwwroot\Gotsap\emphome.aspx.vb Line: 26
Stack Trace:
[NullReferenceException: Object reference not set to an instance of a
object.]
Gotsap.emphome.Page_Load(Object sender, EventArgs e) i
c:\inetpub\wwwroot\Gotsap\emphome.aspx.vb:26
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573
ASP.NET Version:1.1.4322.573
What is the error, i am not able to understand.
Plz help me out.
Thanks in advance.
Lalitha.