views:

93

answers:

2

Hi,

I have a strange problem. While populating formfields, the values are maintained when clicking a'submit' button that causes the page to proceed to the next stage. I try to populate a hidden field from the code behind on the event of a 'find 'button click (before clicking this 'submit' button and this works. But the value is not maintained within the hidden field when clicking the 'submit' button of that page.

Any ideas why this is?

Thanks,

A: 

(Edit to clarify) The value of form fields gets posted back to the server when the form is submitted. If you have an input that is set as type hidden and you set the value of it such that it renders in the source (look at the source after hitting your find button) then the new value will post back as well.

Check if this is the case or if you have anything else overwriting the value.

A: 

Have you have put your code, when you populating your data inside this condition.??

   if (!Page.IsPostBack)
    {
    }

if not, you have to put inside this condition.......

Muhammad Akhtar