1

HI,

I would like to load a aspx page based on a session parameter.

I have a "login name" in the session parameter and i want to show this aspx page if the "login name" session parameter matches a particular "login name"

How can i do this?

Thanks in advance.

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by __avd
0

C# syntax:

if(Session["login name"]!=null)
  {
     string name=Session["login_name"].ToString();
     if(name=='put_text_here')
       {
        }
   }
0

Hi Adatapost!!

Where do i put this code?

In Page_Load event ?

Or in the page that calls this page?

Edited by purell: n/a

1

Either in init or load event of page.

void page_load()
 {
 if(Session["login name"]!=null)
  {
     string name=Session["login_name"].ToString();
     if(name=='put_text_here')
       {
        }
   }
 }
void page_init()
 {
 if(Session["login name"]!=null)
  {
     string name=Session["login_name"].ToString();
     if(name=='put_text_here')
       {
        }
   }
 }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.