Last post Nov 03, 2012 12:22 PM by j4v3d
Oct 27, 2012 09:51 PM|j4v3d|LINK
Im trying to find out how to create a query string an assign to content on a page - so for example i have a list of bookings with event title, category and location, and on each list element there is a book now button that will popup and display a form
with the values already showing in the input fields. I want to pass those details using hidden input fields but im slighlty confused on how to go about this?
Most examples i have seen they show the URL with the query string in there - dont know whether this is pre-loaded or is loaded when they do
I know you can useCode:
string site = Request.QueryString["value"];
Any guidance would be appreciated.
Oct 27, 2012 10:44 PM|nijhawan.saurabh|LINK
Right. So you'll call the second page like this:
Now, in code behind on your second page, you can use the Data VAlues passed to this page as part of querystring:
Note: Make sure data you pass using the querystring isnt large, there's a restriction to the amount of data you can pass using the query string. If the data is large, you have to use the Http post method.
Oct 27, 2012 11:05 PM|j4v3d|LINK
Oct 27, 2012 11:13 PM|nijhawan.saurabh|LINK
I guess you are over thinking.
Aren't you doing this for each user of your site? You might want to store this information into a Session variable, now this information would be accessible across all pages.
If you don't want to use sessions, then you can pass data from one to another using querystring and then store the data in a hidden field on the second page to retrieve that information on that page.
Oct 27, 2012 11:18 PM|j4v3d|LINK
Oct 27, 2012 11:34 PM|nijhawan.saurabh|LINK
You can compare the ways to pass data b/w pages here:
And here's a small sample on usign hiddenfield control:
Nov 03, 2012 12:22 PM|j4v3d|LINK
thanks after a few tries i managed to get there in the end - quite awesome stuff.