Pass value of hidden fields in Gridview to SQL parameter

H

Hennie

I have a field (column) in a gridview with visible set as false.
I need the value of the field to be passed to a parameter in a stored
procedure to update the database.

When a field is hidden (visible=false) the value of the field is no longer
accesable. Is there a work around?
 
E

Eliyahu Goldin

Columns with Visible=false don't render to the client and, naturally, don't
come back to server with postbacks. A work around is to hide the column with
css rule display:none while keeping Visible=true.

Eliyahu
 
P

PeterKellner

I have a field (column) in a gridview with visible set as false.
I need the value of the field to be passed to a parameter in a stored
procedure to update the database.

When a field is hidden (visible=false) the value of the field is no longer
accesable. Is there a work around?

You could also set the gridview attribute
datakeynames=[id,myhiddenfieldid]

and that will let you store in viewstate the value.
Peter Kellner
http://peterkellner.net
 

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,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top