Retrieve value of an asptextbox

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

I am using Web Developer Express 2005. I created a little form to add
some content to a database. I keep the formview default mode in the
insert mode. The values are being added to the database fine.

How do I retrieve a value of one of the textboxes and assign it to a
variable so I can pass it along to a new page after the insert event?

Thanks
 
After serious thinking Michael wrote :
I am using Web Developer Express 2005. I created a little form to add
some content to a database. I keep the formview default mode in the
insert mode. The values are being added to the database fine.

How do I retrieve a value of one of the textboxes and assign it to a
variable so I can pass it along to a new page after the insert event?

Thanks

If you want to "pass variables to another page", then a regular
variable is not enough: After a redirect to that other page all your
variables are cleared.
But this is a very common situation, so there is a common solution:
store the values in Session.

example in C#:

Session["MyValue"] = "Some Value";

string s = (string)Session["MyValue"];

Note: everything is stored as "object", so you need to cast to the
proper type.


Hans Kesting
 
Back
Top