how to pass value to 3rd page?
hi! i am facing a problem when passing value! the situition is like tis:
i hav page A, n i will fill in the text filed, after tat i click 1 button
to page B,
at here, i doesn;t need the value yet; then i will click a button;
to page C,
here i want the value in page A.
any1 know how to solve this problem? thanks ya...!
Pass the value from page B to Page C via the Form collection with a hidden form field.
In Page B:
In Page C:
<input type="hidden" name="someName" value="<%= Request.Form("someName") %>" />
Dim strValue: strValue = Request.Form("someName")
Generally speaking you can pass variables from page to page by:
1) Posting form fields from one page to the next (or to the same page) and on the page to retrieve the value strLName = Request.Form("LName")
2) Using a querystring such as Response.Redirect "login.asp?lname=smith&fname=tom" and on the page to retrieve the values strLName = Request.QueryString("lname") and strFName = Request.QueryString("fname")
3) Using session variables such as Session("LName") = "Smith" and on the page to retrieve the value strLName = Session("LName")
4) Using cookie variables such as Cookie("LName") = "Smith" and on the page to retrieve the value strLName = Cookie("LName")
thanks for giving me the method! i get it now...! izzit tis is the easiest way? but it's good..! hehe..! thanks!
Generally speaking, it would be easier to store the value at Session scope, but more resource hungry.
Hidden form fields/querystrings all the way! It is possibly to write a little routine to loop through the form collection posted to a given page and convert it all into hidden form fields for passing on. Something like:
For Each Item In Request.Form
Response.Write "<input type=""hidden"" name="""&Item&""" value="""&Request.Form(Item)&""" />"
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)