473,397 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Preserving Viewstate on form reload from a popup

Hello, I am having an issue that I haven't been able to find an answer
for. Any help or pointers to information would be appreciated.

I have a form, lets call it mainForm, that contains a dropdownlist of
offices that is populated from a database query, and other form
elements. A second form, lets call it childForm, can be opened
(window.open()) via a link off of mainForm to add another office to the
database. What I would like is to be able to submit childForm, then
have mainForm reload/submit, so the dropdown list of offices is
repopulated with out loosing any previously entere form data.

The problem I have been encountering is that when I use javascript to
submit mainForm, the validators fire, I don't want this. Or when I just
reload mainForm, I lose all previously entered form data. I know the
form data can be saved in the Viewstate, but how do I do it from an
event that comes from a popup window?

Please let me know if I can provide any additional information.
Thank you,
Jeffrey

Nov 19 '05 #1
1 2572
Hi Jeff,

I think that the need to reload the page as opposed to use only Javascript
to add a new <option> tag to your dropdownlist would depend on whether there
are any other values on the page that are dependent on the database changes
occuring when you add the new location.

For example, if adding a new location to the database would create a primary
key that you need before displaying the dropdownlist then you should have the
"Add Location" function save the "mainform" first then redirect the Request
to your "addLocation" page (instead of using window.open) and then return
back to your page after you have reloaded all values appropriately.

But, if adding a new location on the dropdown list only needs the
information that was entered on the "addLocation" popup windows then you can
use Javascript to re-draw that dropdown box without loading the "mainform"
(Notice that the database would still be updated by the "childform".

HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"jeffrobbins" wrote:
Hello, I am having an issue that I haven't been able to find an answer
for. Any help or pointers to information would be appreciated.

I have a form, lets call it mainForm, that contains a dropdownlist of
offices that is populated from a database query, and other form
elements. A second form, lets call it childForm, can be opened
(window.open()) via a link off of mainForm to add another office to the
database. What I would like is to be able to submit childForm, then
have mainForm reload/submit, so the dropdown list of offices is
repopulated with out loosing any previously entere form data.

The problem I have been encountering is that when I use javascript to
submit mainForm, the validators fire, I don't want this. Or when I just
reload mainForm, I lose all previously entered form data. I know the
form data can be saved in the Viewstate, but how do I do it from an
event that comes from a popup window?

Please let me know if I can provide any additional information.
Thank you,
Jeffrey

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Darren | last post by:
I have a page that opens a popup window and within the window, some databse info is submitted and the window closes. It then refreshes the original window using window.opener.location.reload(). ...
9
by: John Kirksey | last post by:
I have a page that uses an in-place editable DataGrid that supports sorting and paging. EnableViewState is turned ON. At the top of the page are several search fields that allow the user to filter...
4
by: Tom Vergote | last post by:
Hi all, I have this page with quite a few textboxes which require viewstate ON. However, i execute some Control.Addatributes on them so the take very much viewstate space (three times a normal...
2
by: GHQ Dev | last post by:
I have an aspx page (page1.aspx) that post back to another aspx page (page2.aspx) “page2.aspx” has a button called back, when the user click on this button it is supposed to return to...
6
by: John | last post by:
Hi all, I am using dynamic user controls within my web app and these controls are loaded into placeholders via the LoadControl method. My problem is this: I have usercontrolA loaded into a...
2
by: fabrice | last post by:
Hi, I have a trouble with my TextBox Control and it's ViewState in my form... The property for it, is FALSE as following : <form id="frmSearchBre4" runat="Server"> <asp:textbox id="myID"...
10
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web...
6
by: sck10 | last post by:
Hello, I have applications that produce the following error when they have been open to long without activity. Is there any way to force a re-load of the page or go to another page if the page...
3
rrocket
by: rrocket | last post by:
I have a group of pages going from step 1 to step x... Everything works okay with that, but on the first page a pop-up is used so a user can create their own info if it is not already in the list. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.