• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 726
  • Last Modified:

ASP.NET HiddenField values not set on post back

I have a number of asp:HiddenField controls within a page that I am using to store values select through the processing of the page. The last step in this page is for the user to enter information in a gridview control (including a dropdownlist) and click a Save button to commit the changes. For the gridview I have a RowCreated function that uses the values in the HiddenField controls to load data in the lists specific to those values. The problem is that the values in the hidden fields are not set yet when rowcreated is called. Is there are fix to this?
0
lonekawboy
Asked:
lonekawboy
1 Solution
 
xav056Commented:
your hidden field values will be lost on postbacks
declare shared variables in your code behind and set those values
shared value1 as string
or
c#
static string value1;
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now