Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have 1 aspx page which as a datagrid containing dyanmic fields also.This page calls a model form.Now when i click on close event of this model form I want to get back to the parent aspx page.What's happening now is i get only static fields and dynamic fields are not seen.

so what should i do .

Please help me.

Thanks in Advance.
Posted
Updated 13-Jun-11 0:26am
v2

As you have found out controls that are added to the DOM on the client do not get saved in ViewState and reconstituted in the code behind. ViewState is encrypted and validated to prevent tampering so there is no way to have the dynamic controls added.

A common method is to use JavaScript and Ajax to send the values of the controls to the server. This can be done using a web service or using PageMethods with ASP.NET.
 
Share this answer
 
Is there any postback happening when you close the modal form. If yes! then you need to recreate the dynamic controls again! I also faced similar issue sometime back and this was the solution.
Hope this helps!
 
Share this answer
 
Turnoff the viewstate is it is of no use, means if you are not retaining the state on postback. Use ajax and bind the control on every postback. So the screen will not flicker, as well as get the output as you want.

Avoid the use of updatepanel, use pagemethod or webservice to do so.

it is just an idea..... may be it helps
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900