Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Retrieve value of an asptextbox

Reply
Thread Tools

Retrieve value of an asptextbox

 
 
Michael
Guest
Posts: n/a
 
      06-25-2008
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
 
Reply With Quote
 
 
 
 
Michael
Guest
Posts: n/a
 
      06-25-2008
Mark,

Dont I have to use some type of findcontrol method ?

Thanks
 
Reply With Quote
 
 
 
 
Hans Kesting
Guest
Posts: n/a
 
      06-25-2008
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieve a value from a Hyperlink Mariame ASP .Net 2 07-28-2004 08:16 AM
Retrieve value from hidden/disabled DropDownList? Cipher ASP .Net 1 07-11-2004 03:52 AM
VB Newbie, Retrieve Listbox value from Control David J Duryea ASP .Net 1 01-27-2004 10:59 AM
How do I retrieve / request a Windows.Form.Control's Value running on a WebForm ? Softwaremaker ASP .Net 2 10-27-2003 02:47 PM
Cannot retrieve the value from the table chanmm ASP .Net 1 08-26-2003 04:52 AM



Advertisments