Request.Form values returned from AllKeys not what I want.

H

hazz

Form: ItemsGrid$ctl02$CheckBox1
is the value printed from the Response.Write for the row below.
How would one obtain the other cell values in that row?
The first value (<td>1</td>) is the one I want. That is the primary key in
the table that will be updated with the changed checkbox value.
Thank you. -Greg

coll=Request.Form;
// Get names of all forms into a string array.
String[] arr1 = coll.AllKeys;
for (loop1 = 0; loop1 < arr1.Length; loop1++)
{
Response.Write("Form: " + arr1[loop1] + "<br>");
}


<tr>
<td>1</td><td>CO_NUMBER</td><td>
<input id="ItemsGrid_ctl02_CheckBox1" type="checkbox"
name="ItemsGrid$ctl02$CheckBox1" checked="checked" />
</td>
</tr>
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

By putting them in a form field so that they are posted to the server,
as you can't obtain a value that is not sent to the server. You can use
hidden fields to put the values in.
 
H

hazz

Thank you very much Göran. This is how I did this several years ago. This
makes sense. I believe that it's the HttpRequest object that provides this.
Thanks again.
-Greg

Göran Andersson said:
By putting them in a form field so that they are posted to the server, as
you can't obtain a value that is not sent to the server. You can use
hidden fields to put the values in.
Form: ItemsGrid$ctl02$CheckBox1
is the value printed from the Response.Write for the row below.
How would one obtain the other cell values in that row?
The first value (<td>1</td>) is the one I want. That is the primary key
in the table that will be updated with the changed checkbox value.
Thank you. -Greg

coll=Request.Form;
// Get names of all forms into a string array.
String[] arr1 = coll.AllKeys;
for (loop1 = 0; loop1 < arr1.Length; loop1++)
{
Response.Write("Form: " + arr1[loop1] + "<br>");
}


<tr>
<td>1</td><td>CO_NUMBER</td><td>
<input id="ItemsGrid_ctl02_CheckBox1" type="checkbox"
name="ItemsGrid$ctl02$CheckBox1" checked="checked" />
</td>
</tr>
 

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

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top