Last post May 03, 2012 05:06 AM by santosh.prasanna
May 02, 2012 11:51 PM|JayDubbya|LINK
I haven't done this before and need some guidance.
I need to collect the value from a hidden field on a GridView and pass that value to an SQL Server stored procedure in order to create a new row in the gridview and assign the foreign key value to the appropriate field in the underlying table.
Unfortunately I'm not conversant with C# so VB.Net examples etc. please.
I'm not really sure how to have the stored procedure locate and use the value either.
May 03, 2012 03:03 AM|basheerkal|LINK
Add that field as the DataKeyNames of the GridView and retrieve it in RowDataBound event.
Check his link for some clues.
May 03, 2012 03:39 AM|ZeeshanAnsari11|LINK
the value which your binding to hidden field inside fieldtemplate
that can be retrieved in rowdatabound event as
HiddenField hdnFD= (HiddenField)e.Row.FindControl("hdnField1");
hdnFD.Value; // pass this value to your sp.
I hope this helps
May 03, 2012 05:06 AM|santosh.prasanna|LINK
I have the same scenario . And the below code help me a lot :-).