By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,077 Members | 1,309 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,077 IT Pros & Developers. It's quick & easy.

101 Question - Passing a value from one page to another

P: n/a
I'm using a Public variable that I set on one page so that it will be
available for another page but, I know this isn't the way it should be done.
Being an Access Developer, how would I do the same thing in ASP.NET as:
opening a form and passing a value to OpenArgs so that the next form can
access that value?

Also, for using a selected value from a DataGrid, could someone please show
me the convention (and steps - please?) for opening a detailed page(1 row)
using that value that was selected from the dataGrid on another page? I have
read many examples, but I guess, they are assuming a lot of things that I
should know, because I still can't figure out how to do it - I'm confused
about which event to use - the ChangeSelectedIndex OR the 'Select' button
link... it couldn't be both those events - or could it?

Dec 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
here's a thought for your first question:

Store the value in the Session (a server side var)
protected void Page_Load(object sender, EventArgs e)
{
string myValue = "some value";
Session.Add("MyValue", myValue);
}

You can then retrieve the value on the destination page (using e.g.
(string)Session["MyValue"])

A second way would be to use the application Cache, which asks for
additional information, like how long you want the value to remain
cached, etc.

Dec 22 '05 #2

P: n/a
One other way would be to pass the value as a querystring parameter to
the next page.

albert braun wrote:
here's a thought for your first question:

Store the value in the Session (a server side var)
protected void Page_Load(object sender, EventArgs e)
{
string myValue = "some value";
Session.Add("MyValue", myValue);
}

You can then retrieve the value on the destination page (using e.g.
(string)Session["MyValue"])

A second way would be to use the application Cache, which asks for
additional information, like how long you want the value to remain
cached, etc.

Dec 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.