Getting value from session

Results 1 to 3 of 3

Thread: Getting value from session

  1. #1
    Join Date
    Dec 1969

    Default Getting value from session

    Hi,<BR> I&#039;m using as scripting language in my application.I set a session in one page and retrieving in another page.While retrieving it I&#039;m facing problem in casting it.<BR><BR>The code is<BR><BR><BR>//first.aspx<BR><BR><BR>Dim arr<BR><BR>arr(0)="firstname"<BR>arr(1)="LastName" <BR>session("UserInfo")=arr<BR><BR><BR>//second.aspx<BR><BR>Dim arr1<BR><BR>arr1=session("UserInfo") //I&#039;m facing problem here.<BR><BR><BR>Can anybody help me out??<BR><BR>Thanks in advance.

  2. #2
    Join Date
    Dec 1969

    Default try this...

    actually i dont know the code in try this c# code..u can easly<BR>in Global.asax....<BR><BR>string [] str=new string[2];//it should declare at top above Application_Start(--)<BR>then in session start...<BR>-----------------------<BR>Session["s"]=str;<BR><BR>again in first.aspx...<BR>-----------------------<BR>string [] arr=new String[2];<BR>arr(0)="firstname"<BR>arr(1)="LastName"<BR>th en....Session["s"]=(string[]) arr;<BR><BR>use it in the second.aspx.............<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Getting value from session

    what error are u getting? <BR>also try declaring the variables with the types like<BR>dim arr() as string

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts