473,406 Members | 2,713 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,406 software developers and data experts.

Javascript Popup window

This is for a search page that takes parameters on one page, processes the
query, and displays them on another page.
I've got a javascript popup window on a button click event. When the user
clicks the button, the popup window opens, and the parent page goes on with
the query. No problem there. The problems comes in when one of my
validator's throws an error, then naturally the page does not post back
waiting for the page to valid. However, the button click event still
happens on the client side, so the popup window opens, saying processing
query..... How do I stop the javascript function from running if the page
is not valid? Anyone with any ideas, or alternate plans would be greatly
appreciated. Thank you.
Nov 18 '05 #1
5 2004
Could you use a normal asp button with postback and use the
Page.RegisterStartupScript to write the javascript to open the window in the
event handler only if the page is valid??? I use code like this for sending
conditional js/page error messages to the user based on event handler
conditional testing...

Earl
"Paul Krasucki" <no****@yahoo.com> wrote in message
news:uf****************@TK2MSFTNGP11.phx.gbl...
This is for a search page that takes parameters on one page, processes the
query, and displays them on another page.
I've got a javascript popup window on a button click event. When the user
clicks the button, the popup window opens, and the parent page goes on with the query. No problem there. The problems comes in when one of my
validator's throws an error, then naturally the page does not post back
waiting for the page to valid. However, the button click event still
happens on the client side, so the popup window opens, saying processing
query..... How do I stop the javascript function from running if the page
is not valid? Anyone with any ideas, or alternate plans would be greatly
appreciated. Thank you.

Nov 18 '05 #2
That does sound like a plan. But it will be something I'll have to read up
on, but I've got the weekend to do that. I can still force a server side
post back from a standard asp button right, I probably just have to set the
runat="server" right? THank you for your help.

"Earl Teigrob" <ea******@hotmail.com> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
Could you use a normal asp button with postback and use the
Page.RegisterStartupScript to write the javascript to open the window in the event handler only if the page is valid??? I use code like this for sending conditional js/page error messages to the user based on event handler
conditional testing...

Earl
"Paul Krasucki" <no****@yahoo.com> wrote in message
news:uf****************@TK2MSFTNGP11.phx.gbl...
This is for a search page that takes parameters on one page, processes the query, and displays them on another page.
I've got a javascript popup window on a button click event. When the user clicks the button, the popup window opens, and the parent page goes on

with
the query. No problem there. The problems comes in when one of my
validator's throws an error, then naturally the page does not post back
waiting for the page to valid. However, the button click event still
happens on the client side, so the popup window opens, saying processing
query..... How do I stop the javascript function from running if the page is not valid? Anyone with any ideas, or alternate plans would be greatly appreciated. Thank you.


Nov 18 '05 #3
Paul,

Yes, using a standard asp.net button control should work fine...It will post
back to the server where you will test for Page.IsValid and take action
based on the results. If you use this approch, you will not need to write
any javascript into the button itself (asp.net will add the js to generate a
post back, of course)

Earl

"Paul Krasucki" <no****@yahoo.com> wrote in message
news:OR****************@TK2MSFTNGP10.phx.gbl...
That does sound like a plan. But it will be something I'll have to read up on, but I've got the weekend to do that. I can still force a server side
post back from a standard asp button right, I probably just have to set the runat="server" right? THank you for your help.

"Earl Teigrob" <ea******@hotmail.com> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
Could you use a normal asp button with postback and use the
Page.RegisterStartupScript to write the javascript to open the window in

the
event handler only if the page is valid??? I use code like this for

sending
conditional js/page error messages to the user based on event handler
conditional testing...

Earl
"Paul Krasucki" <no****@yahoo.com> wrote in message
news:uf****************@TK2MSFTNGP11.phx.gbl...
This is for a search page that takes parameters on one page, processes the query, and displays them on another page.
I've got a javascript popup window on a button click event. When the user clicks the button, the popup window opens, and the parent page goes on

with
the query. No problem there. The problems comes in when one of my
validator's throws an error, then naturally the page does not post back waiting for the page to valid. However, the button click event still
happens on the client side, so the popup window opens, saying processing query..... How do I stop the javascript function from running if the page is not valid? Anyone with any ideas, or alternate plans would be greatly appreciated. Thank you.



Nov 18 '05 #4
Paul Krasucki wrote:
This is for a search page that takes parameters on one page, processes the
query, and displays them on another page.
I've got a javascript popup window on a button click event. When the user
clicks the button, the popup window opens, and the parent page goes on with
the query. No problem there. The problems comes in when one of my
validator's throws an error, then naturally the page does not post back
waiting for the page to valid. However, the button click event still
happens on the client side, so the popup window opens, saying processing
query..... How do I stop the javascript function from running if the page
is not valid? Anyone with any ideas, or alternate plans would be greatly
appreciated. Thank you.


In your client side code you should check the Page_IsValid variable to
see if the page passed client-side validation.

For some details see the "Client-Side Validation for ASP.NET Server
Controls" .NEt Framework help file entry.

You may need to rework your script so that the client side validation
occurs before your click handler does its work (so the Page_IsValid
variable will be set correctly). To do this you may need to call the
client script function Page_ClientValidate().

See the .NET Framework help topics:

"Script Library for Validator Sample", and
"Client-Side Functionality in a Server Control"

for more details.

You should also look at the WebUIValidation.js client side script
library that ASP.NET uses to support client side validation. That file
is normally installed in:

c:\inetpub\wwwroot\aspnet_client\system_web\xxxxxx

where xxxxxx is a folder name that corresponds to the version of the
..NET runtime installed.

--
mikeb
Nov 18 '05 #5
Thank you to everyone that has helped me with this. I have several ways to
approach this at this point, which is great. Thank you.
"mikeb" <ma************@mailnull.com> wrote in message
news:ud****************@TK2MSFTNGP10.phx.gbl...
Paul Krasucki wrote:
This is for a search page that takes parameters on one page, processes the query, and displays them on another page.
I've got a javascript popup window on a button click event. When the user clicks the button, the popup window opens, and the parent page goes on with the query. No problem there. The problems comes in when one of my
validator's throws an error, then naturally the page does not post back
waiting for the page to valid. However, the button click event still
happens on the client side, so the popup window opens, saying processing
query..... How do I stop the javascript function from running if the page is not valid? Anyone with any ideas, or alternate plans would be greatly appreciated. Thank you.


In your client side code you should check the Page_IsValid variable to
see if the page passed client-side validation.

For some details see the "Client-Side Validation for ASP.NET Server
Controls" .NEt Framework help file entry.

You may need to rework your script so that the client side validation
occurs before your click handler does its work (so the Page_IsValid
variable will be set correctly). To do this you may need to call the
client script function Page_ClientValidate().

See the .NET Framework help topics:

"Script Library for Validator Sample", and
"Client-Side Functionality in a Server Control"

for more details.

You should also look at the WebUIValidation.js client side script
library that ASP.NET uses to support client side validation. That file
is normally installed in:

c:\inetpub\wwwroot\aspnet_client\system_web\xxxxxx

where xxxxxx is a folder name that corresponds to the version of the
.NET runtime installed.

--
mikeb

Nov 18 '05 #6

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

Similar topics

3
by: Arthur Connor | last post by:
Below you will find the first lines of my HTML page. Why doesn't popup a dialog window ? I click the Html page which is on my hard disc. A IE 5.5 browser window opens but not a dialog window...
2
by: Jeannie | last post by:
I have a popup window which is a slideshow of about 7 images. When the popup window loads, the first image is present and then the viewer can select next or previous to scroll through the rest of...
14
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
9
by: Robby Bankston | last post by:
I'm working on some code and am running into brick walls. I'm trying to write out Javascript with Javascript and I've read the clj Meta FAQ and didn't see the answer, read many similar posts (with...
6
by: szabelin | last post by:
Hello, I am trying to call a function inside the javascript block from asp.net during the postback (NOT button's OnClick event handler though). The javascript function creates new popup window. I...
12
by: Mark Fox | last post by:
Hello, I am attempting to do something very simple. I have a page MainPage.aspx and a popup window Popup.aspx. When users click on the linkbutton in the popup window I am looking to do some...
8
by: Terry | last post by:
I am loading a javascript function from my asp.net app. This function loads a string passed to it in a new window. I register the function to activate on click of an asp linkbutton. Now when...
9
by: tshad | last post by:
This is from my previous post, but a different issue. I have the following Javascript routine that opens a popup page, but doesn't seem to work if called from an asp.net button. It seems to work...
4
by: Matt Jensen | last post by:
Howdy all Hopefully I can explain my problem straightforwardly. In it's simplest explanation, what I want to do is have a hyperlink that, when clicked, executes some client side JavaScript and...
4
by: E | last post by:
I am having trouble with setTimeout working on a second call to the setTimeout function from a second page which is an html page. Here is the scenario. I have a web page and onload it calls a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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 project—planning, 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.