How to passing data from one webpage to a new webpages?
Hi Guys, i have some difficulties and need your help.
Let say i have a webpage name "a.aspx" and another name "b.aspx"
when i click a button in a.aspx and the event will
response.redirect("b.aspx")
how can i pass some data that is in a.aspx to b.aspx?
i.e i want to pass a string variable(name: strA) in a.aspx to b.aspx, how should i code?
:wave:
Re: How to passing data from one webpage to a new webpages?
how do pass as a session variable?
because i dont want to let a user to see it
:wave:
Re: How to passing data from one webpage to a new webpages?
In your first page, use something like
Code:
Session['strA'] = "My String";
Response.Redirect('b.aspx');
In b.aspx:
Code:
string strA = (string) Session['strA'];
This is assuming that you're writing in C#. For VB.NET the syntax is *slightly* different.
Re: How to passing data from one webpage to a new webpages?
if i want to pass session variable of strA to b.apsx textbox control(i.e, textbox name: txtStrA)
how to pass ?
can give sample code in vb.net?
:blush:
Re: How to passing data from one webpage to a new webpages?
Code:
txtStrA.Text = Session("username").ToString()
I suggest a basic vb.net/asp.net tutorial first...