views:

28

answers:

1

Hey,

I have this problem when trying to read a session in another asp.net page.

Object reference not set to an instance of an object.

If Session("cne").Equals("") Then
Response.Redirect("Default.aspx")
End If

I'm setting the session in the Default page with this code :

Session("cne") = cne.Text

Thanks.

+2  A: 
Dim cne = Session("cne")
If cne Is Nothing OrElse cne.Equals("") Then 
    Response.Redirect("~")
End If
Joel Coehoorn
Thanks it's working.
dotNET