Hey Just wondering how the following can happen
Object reference not set to an instance of an object.
customerName.Text = Session("userName").ToString()
If (Session("userId") Is Nothing) Then
Response.Redirect(ConfigurationManager.AppSettings("site_base_url").ToString & "login/", False)
End If
customerName.Text = Session("userName").ToString()
Now I currently have no session set on this page. So the session is NULL but i am just wondering why my if statement is taking care of this problem, why does it even try to get to the next part i.e. Response.Write ?
userNamesession variable is null. It should crash when you initially attempt to assignuserNameto your text field. Is this where the behavior is occuring? You stated in your question, there are no session variables set at this point.