How to Set, Postback, and retrieve hiddenField value?

Chierneceb

New Member
The title pretty much says it all but i to ellaborate, i have a asp gridview with 3 input type"text" fields in it. Those fields get populated by a query and each row has the option to EDIT. When i click the edit button in the gridview, it postback but the value of the input fields are of course lost during the post back :(. So i wanted to store the values into a hiddenfield and then use it on server side. These are within an edititemtemplate tag.\[code\]<input type="text" id="editBeginDate" class="DatePicker" runat="server" readonly="readonly" /><asp:HiddenField ID="ehBeginDate" runat="server" />\[/code\]I am setting the value of the hidden field at document.ready via jquery using this...\[code\] $(document).ready(function () { $("[id$=ehBeginDate]").val(); });\[/code\]What is happening when the user clicks edit, it sets the row to edit mode but the value in these 3 input fields is set to empty because it gets "lost" some where in the post back. My plan is to retrieve the hiddenfield value (and take over the world! jk) and then do .findcontrol("inputfield") and set its text = hiddenfield.value... thoughts??thanks!
 
Back
Top