Thursday, March 29, 2012
session value
page.
How can I take session value.
script="<Language=VBScript> session(\"Id\")= ";
script+= kullaniciId;
script+="</script>";
Page.RegisterStartupScript("Startup", script);
Thanks.Hello Selen,
The result of your code will result code like that in the HTML page sent
to the browser
<script language=VBScript>
session("id")=123
</script>
and this code is a client side code so you can't affect the session
object on the server !!! I think you have to change you technique. If I
misunderstand you please tell me.
Thanks
--
Mohamed Sharaf
Microsoft GTSC Developer support for Middle East
"selen" <skiyanc@.yahoo.com> wrote in message
news:OR$qP9M4DHA.488@.TK2MSFTNGP12.phx.gbl...
> I am using belove code.I want to send session's value a variable in
another
> page.
> How can I take session value.
>
>
> script="<Language=VBScript> session(\"Id\")= ";
> script+= kullaniciId;
> script+="</script>";
> Page.RegisterStartupScript("Startup", script);
>
> Thanks.
Thank you.I find solution.
I used Session["key"]="value";
string=(string)Session["key"];
"Mohamed Sharaf" <Mohamed.Sharaf@.egdsc.microsoft.com>, iletide unu yazd
news:%23CALSVN4DHA.2388@.TK2MSFTNGP09.phx.gbl...
> Hello Selen,
> The result of your code will result code like that in the HTML page
sent
> to the browser
> <script language=VBScript>
> session("id")=123
> </script>
> and this code is a client side code so you can't affect the session
> object on the server !!! I think you have to change you technique. If I
> misunderstand you please tell me.
> Thanks
> --
> Mohamed Sharaf
> Microsoft GTSC Developer support for Middle East
>
> "selen" <skiyanc@.yahoo.com> wrote in message
> news:OR$qP9M4DHA.488@.TK2MSFTNGP12.phx.gbl...
> > I am using belove code.I want to send session's value a variable in
> another
> > page.
> > How can I take session value.
> > script="<Language=VBScript> session(\"Id\")= ";
> > script+= kullaniciId;
> > script+="</script>";
> > Page.RegisterStartupScript("Startup", script);
> > Thanks.
Monday, March 26, 2012
Session variable got lost after I switched to another server
like
Session["USERID"]=3;
Server.transfer("anotherpage.aspx");
In anotherpage.aspx in page load I check to see if that Session is null, if
it's not show a javascript message window with the ID. The funny thing is
that the window is open, ->the variable gets to this page. Good, untill now!
If I click a button from this anotherpage.aspx to
Server.transfer(clients.aspx) and in clients.aspx I try to acces the
Session["USERID"] it says that it is gone (I mean if I cast to string type,
the resulting value is null).
Now the boom (for me) At work (Win 2000) this used to work, however when I
transfered at my house (WinXP Pro SP 1 with all updates) it doesn't!!!!
What happens to that variable'Can you write out the value of your session id to make sure it is not
changing between postbacks?
"Vlady" wrote:
> The scenario is the following: from the login page I set a session variabl
e
> like
> Session["USERID"]=3;
> Server.transfer("anotherpage.aspx");
> In anotherpage.aspx in page load I check to see if that Session is null, i
f
> it's not show a javascript message window with the ID. The funny thing is
> that the window is open, ->the variable gets to this page. Good, untill no
w!
> If I click a button from this anotherpage.aspx to
> Server.transfer(clients.aspx) and in clients.aspx I try to acces the
> Session["USERID"] it says that it is gone (I mean if I cast to string type
,
> the resulting value is null).
> Now the boom (for me) At work (Win 2000) this used to work, however when I
> transfered at my house (WinXP Pro SP 1 with all updates) it doesn't!!!!
> What happens to that variable'
Session variable got lost after I switched to another server
like
Session["USERID"]=3;
Server.transfer("anotherpage.aspx");
In anotherpage.aspx in page load I check to see if that Session is null, if
it's not show a javascript message window with the ID. The funny thing is
that the window is open, ->the variable gets to this page. Good, untill now!
If I click a button from this anotherpage.aspx to
Server.transfer(clients.aspx) and in clients.aspx I try to acces the
Session["USERID"] it says that it is gone (I mean if I cast to string type,
the resulting value is null).
Now the boom (for me) At work (Win 2000) this used to work, however when I
transfered at my house (WinXP Pro SP 1 with all updates) it doesn't!!!!
What happens to that variable??Can you write out the value of your session id to make sure it is not
changing between postbacks?
"Vlady" wrote:
> The scenario is the following: from the login page I set a session variable
> like
> Session["USERID"]=3;
> Server.transfer("anotherpage.aspx");
> In anotherpage.aspx in page load I check to see if that Session is null, if
> it's not show a javascript message window with the ID. The funny thing is
> that the window is open, ->the variable gets to this page. Good, untill now!
> If I click a button from this anotherpage.aspx to
> Server.transfer(clients.aspx) and in clients.aspx I try to acces the
> Session["USERID"] it says that it is gone (I mean if I cast to string type,
> the resulting value is null).
> Now the boom (for me) At work (Win 2000) this used to work, however when I
> transfered at my house (WinXP Pro SP 1 with all updates) it doesn't!!!!
> What happens to that variable??