Saturday, March 24, 2012

passing variables between pages

I have a web app that searches a database and returns a datagrid table.
the user inputs the search terms into a textbox. The user selects the
info he wants and it sends him to a 2nd page, after another selection
it goes to a 3rd page. I have been able to pass the search term in my
textbox back and forth to all the pages using Context.items. Now the
user may click a button that is supposed to take him back to the first
page and reload the original datagrid. How do I get the variable
containing the search terms from the 3rd page back to the 1st page and
automatically perform the search or is there another way to recall the
datagrid? thanks.can u keep the search variables in session?
bineesh
<lacombpcs@.juno.com> wrote in message
news:1117539066.532083.18140@.g49g2000cwa.googlegroups.com...
> I have a web app that searches a database and returns a datagrid table.
> the user inputs the search terms into a textbox. The user selects the
> info he wants and it sends him to a 2nd page, after another selection
> it goes to a 3rd page. I have been able to pass the search term in my
> textbox back and forth to all the pages using Context.items. Now the
> user may click a button that is supposed to take him back to the first
> page and reload the original datagrid. How do I get the variable
> containing the search terms from the 3rd page back to the 1st page and
> automatically perform the search or is there another way to recall the
> datagrid? thanks.
>
Why won't you put it in a session variable?
Eliyahu
<lacombpcs@.juno.com> wrote in message
news:1117539066.532083.18140@.g49g2000cwa.googlegroups.com...
> I have a web app that searches a database and returns a datagrid table.
> the user inputs the search terms into a textbox. The user selects the
> info he wants and it sends him to a 2nd page, after another selection
> it goes to a 3rd page. I have been able to pass the search term in my
> textbox back and forth to all the pages using Context.items. Now the
> user may click a button that is supposed to take him back to the first
> page and reload the original datagrid. How do I get the variable
> containing the search terms from the 3rd page back to the 1st page and
> automatically perform the search or is there another way to recall the
> datagrid? thanks.
>
You could session variables (as already mentioned), you could still use
context items provided you know what the originating page was (ie. the fact
it came from the 3rd page). You could use an argument in the URL/query
string to set this. You could also save his info to a database, and use the
query string info to flag a reload of that info from the database.
There are many options.
- Paul Glavich
ASP.NET MVP
ASPInsider (www.aspinsiders.com)
<lacombpcs@.juno.com> wrote in message
news:1117539066.532083.18140@.g49g2000cwa.googlegroups.com...
> I have a web app that searches a database and returns a datagrid table.
> the user inputs the search terms into a textbox. The user selects the
> info he wants and it sends him to a 2nd page, after another selection
> it goes to a 3rd page. I have been able to pass the search term in my
> textbox back and forth to all the pages using Context.items. Now the
> user may click a button that is supposed to take him back to the first
> page and reload the original datagrid. How do I get the variable
> containing the search terms from the 3rd page back to the 1st page and
> automatically perform the search or is there another way to recall the
> datagrid? thanks.
>

0 comments:

Post a Comment