By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,905 Members | 902 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,905 IT Pros & Developers. It's quick & easy.

update checkbox values from gridview to database table.

P: n/a
What do I do to capture the checkbox values as listed below in order to
update the database table. There will be an ID field also contained in the
row to use in the update query. What would I put in the Button Click event?
Thank you. -Greg

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

protected void Button1_Click(object sender, EventArgs e)
{
Request.Form["??????"];
}
May 2 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Looks like this will give me something to start with;

int loop1;
NameValueCollection coll;
//Load Form variables into NameValueCollection variable.
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>");

"hazz" <hazz@sonic_net> wrote in message
news:uj**************@TK2MSFTNGP02.phx.gbl...
What do I do to capture the checkbox values as listed below in order to
update the database table. There will be an ID field also contained in the
row to use in the update query. What would I put in the Button Click
event? Thank you. -Greg

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

protected void Button1_Click(object sender, EventArgs e)
{
Request.Form["??????"];
}

May 3 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.