473,545 Members | 529 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2578
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 "addLocatio n" 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 "addLocatio n" 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
"jeffrobbin s" 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
31014
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(). The problem is that after the reload, it brings you right to the top of the page. When I click 'refresh" on the original page, it brings me back to...
9
21630
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 the results in the grid. Say you filter the grid for records that have a certain condition set to "NO" (in this case a checkbox). In this scenario...
4
2033
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 textbox). Those attributes can easily be readded with every request, so those don't need to be in the viewstate, only what the user entered in it. ...
2
1777
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 “page1.aspx”, when the user returns to “page1.aspx” I want to restore the viewstate of the page so the page would have the same data as the user...
6
2731
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 placholder and the user clicks on a specific control outside of the usercontrol and some Javascript is run where a hidden variable is changed to...
2
2228
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" TabIndex="1" EnableViewState="false" MaxLength="50" runat="server" TextMode="SingleLine"> </asp:textbox>
10
3067
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 config does specify a machinekey setting: <machineKey...
6
2925
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 has expired instead of getting the error? Thanks,
3
3553
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. Once the pop-up is closed the information currently on the main page is lost. What is the best way to store the information so that not everything is...
0
7465
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main...
1
7416
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7752
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5969
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, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5325
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 presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3449
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1878
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
701
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.