Dynamic table and postback

Hi,

I have an asp Table control in a page and the rows are creating dynamically. I generating pdf file when clicking on button and downloading it(the values are taking from the dynamically created rows.).In postback I should refill the table rows again. otherwise the pdf file will be blank.Please provide me a solution.(ie,Table is losing its rows that was added dynamically, on PostBack )

Question is not clear, But try this store the created rows values in the session/view and use them for creating the PDF file.ThanksShivshanker Cheral"If you share your assets (money etc..) it will decrease, But if you share your knowledge it will increase!!! ".

This is the reason Microsoft introduce the concept called Statemanagement, using this concept you can maintain state of your controls. We have different types of StateManagment controls available as per Microsoft based on our need we need to choose which one is needed in our case.

Ex:ViewStateSessionCacheCookiesApplications

These all are maintain data after postback but each of the concept having some extra features based on your requirement you want to maintain state with in page, my suggestion is you can use ViewState Management, using this you can maintain your data without loose it.

Ex:

storing into ViewStateViewState["Data"]=//your data;

Get back from ViewStateDataTable dt=ViewState["Data"] as DataTable// I assume that you are stored DataTable data

Dynamic controls must be re-added to the form on each postback. Typically this is done during the Init phase of the page's lifecycle. The controls that you have added dynamically DO actually have ViewState. When the appropriate control is re-added to the control tree using the exact same ID it had before, it should reappear with the values that were persisted in ViewStatecheck out below link for more detailshttp://geekswithblogs.net/shahed/archive/2008/06/26/123391.aspxThanksKoolprasd2003Editor, DotNetSpider MVMMicrosoft MVP 2014 [ASP.NET/IIS]