Saving fields from popup page

  • Thread starter Thread starter Sanjeev Mahajan via .NET 247
  • Start date Start date
S

Sanjeev Mahajan via .NET 247

Hi All,

I have a main page from which I am calling a popup page. Thepopup page has an editable grid and some other fields. There isalso a Save button on the popup page. When the user clicks theSave button on the popup page, I want to save the values in thedatagrid as a dataset into the ViewState of the main page. Can Iaccess the ViewState of the main page in the popup page? If not,what is the way out?

Thanks,
Sanjeev
 
Hi Sanjeev,

If you launch your popup as a modal window you can set the
window.resultValue to a comma delimited (or other delimiter) string. Then
you will have the data in your main page, set that data to a hidden input
field that has the runat="server" tag set. Then when your main page does a
postback, parse this hidden field and add the values to your dataset. I
don't know of anyway to mess with the view state with javascript to
programmatically add these values to a dataset. Good luck! Ken.

P.S. If you can't use a modal form then you can send your data directly back
to the hidden field on your main page with the following line:
window.opener.document.getElementById('hiddenfield').value = data;
window.close(); (automatically closes your popup)

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight

Hi All,

I have a main page from which I am calling a popup page. The popup page has
an editable grid and some other fields. There is also a Save button on the
popup page. When the user clicks the Save button on the popup page, I want
to save the values in the datagrid as a dataset into the ViewState of the
main page. Can I access the ViewState of the main page in the popup page? If
not, what is the way out?

Thanks,
Sanjeev
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top