Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > grabbing values from standard INPUT TEXT fields that are being dynamically written?

Reply
Thread Tools

grabbing values from standard INPUT TEXT fields that are being dynamically written?

 
 
Darrel
Guest
Posts: n/a
 
      11-13-2004
I'm writing out my own Table via codebehind. Each row has an INPUT
TYPE="TEXT" that I am writing out dynamically as well.

I want people to be able to update this text, then, upon submit, I'm going
to walk through each one to update the DB.

How do I access these form fields from the codebehind? I know I can put a
RUNAT="SERVER" on this and then I could register it in the codebehind, but I
can't predict how many INPUTS I'll need on the page. The catch is that I
can't register an object that hasn't been written to the page yet, so any
attempt at referencing the item in my codebehind just gives me an error.

(I do realize that using a datagrid would work, but I need the HTML output
to by much more customized than the default datagrid output..namely for
accessibility reasons)

-Darrel


 
Reply With Quote
 
 
 
 
Scott M.
Guest
Posts: n/a
 
      11-13-2004
You can grab any and all form data via the Request object.

Dim user as String = Request("txtUser")


"Darrel" <> wrote in message
news:...
> I'm writing out my own Table via codebehind. Each row has an INPUT
> TYPE="TEXT" that I am writing out dynamically as well.
>
> I want people to be able to update this text, then, upon submit, I'm going
> to walk through each one to update the DB.
>
> How do I access these form fields from the codebehind? I know I can put a
> RUNAT="SERVER" on this and then I could register it in the codebehind, but
> I can't predict how many INPUTS I'll need on the page. The catch is that I
> can't register an object that hasn't been written to the page yet, so any
> attempt at referencing the item in my codebehind just gives me an error.
>
> (I do realize that using a datagrid would work, but I need the HTML output
> to by much more customized than the default datagrid output..namely for
> accessibility reasons)
>
> -Darrel
>



 
Reply With Quote
 
 
 
 
Darrel
Guest
Posts: n/a
 
      11-13-2004
> Dim user as String = Request("txtUser")

Argh. So simple. Thanks! ;o)


 
Reply With Quote
 
Scott M.
Guest
Posts: n/a
 
      11-13-2004
....And, if you don't know the names of the items or how many there will be
you can do this:

Dim I as Integer
Dim formValue() as String
For I = 0 to Request.Forms.Count -1
formValue(I) = Request(I)
Next

After this is done, you have all the form data stored in an Array.

"Darrel" <> wrote in message
news:...
>> Dim user as String = Request("txtUser")

>
> Argh. So simple. Thanks! ;o)
>



 
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
Trouble with parsing text file and grabbing values needed donaldjones@gmail.com Perl Misc 8 07-22-2006 06:10 PM
Grabbing single ASCII values pasted into a text area Kermit Piper Javascript 1 03-12-2006 12:50 AM
Grabbing ASCII values in a text box Kermit Piper Javascript 1 03-10-2006 03:25 AM
Problem with events on dynamically created input fields in internet explorer Thomas Javascript 6 04-15-2005 01:00 AM
Dynamically creating input fields? Peter Kirk Javascript 1 09-28-2004 04:40 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57