Hi,
what you're doing here is with QueryString, not session objects. In that
case, your second line would look like: -
Label1.Text = "MyID=" + Convert.ToString( Request.QueryString["MyID"]);
Or else, if you want to use ASP.NET session object, set the session object
in the first page as follows :-
if (!PostBack)
{
Page.Session["MyID"] = 7;
}
then call it from the second page :-
Label1.Text = "MyID=" + Convert.ToString( Page.Session["MyID"]);
Regards
Joyjit
"Magnus Blomberg" <ma*************@skanska.se> wrote in message
news:ut**************@tk2msftngp13.phx.gbl...
Hello!
I'm quite new to ASP.Net and trying to send a variable from one page to
another.
Om my first page, Index.htm page I have a link as:
<a href="Default.aspx?MyID=7">Def 7</a>
On Default.aspx I have following code in the load event:
Label1.Text = "MyID=" + Convert.ToString( Page.Session["MyID"]);
I really think it would work, but I only get the text MyID=.
Is the <a> tag not setting a session variable?
Any ideas
/Magnus