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

D

Darrel

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
 
S

Scott M.

You can grab any and all form data via the Request object.

Dim user as String = Request("txtUser")
 
S

Scott M.

....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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top