Suppose i have 2 pages 'A' and 'B'. i set a session variable in 'A', that is checked in page_load function in page 'B' using:
if (!string.IsNullOrEmpty(Session["x"].ToString()))
{
}
and the appropriate actions are performed based on the value of that session variable but if I open page 'B' first , it gives the error:
Object reference not set to an instance of an object.
How do i set the instance of this object beforehand itself?