|
-
Dec 8th, 2004, 01:09 AM
#1
Thread Starter
Lively Member
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?
Last edited by kkc; Dec 12th, 2004 at 10:22 PM.
-
Dec 8th, 2004, 04:13 AM
#2
Frenzied Member
You could pass it along as a QueryString variable? Or a session variable if you don't want the user to see it. Personally, I'd go with the QueryString 
Code:
Response.Redirect('b.aspx?strA=My%20String');
-
Dec 8th, 2004, 07:51 PM
#3
Thread Starter
Lively Member
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
-
Dec 9th, 2004, 03:54 AM
#4
Frenzied Member
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.
-
Dec 9th, 2004, 08:56 PM
#5
Thread Starter
Lively Member
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?
-
Dec 9th, 2004, 11:41 PM
#6
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...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|