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. 5 2024
Could you use a normal asp button with postback and use the
Page.RegisterSt artupScript 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.c om> wrote in message
news:uf******** ********@TK2MSF TNGP11.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.
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******@hotma il.com> wrote in message
news:%2******** **********@TK2M SFTNGP12.phx.gb l... Could you use a normal asp button with postback and use the Page.RegisterSt artupScript 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.c om> wrote in message news:uf******** ********@TK2MSF TNGP11.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.
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.c om> wrote in message
news:OR******** ********@TK2MSF TNGP10.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******@hotma il.com> wrote in message news:%2******** **********@TK2M SFTNGP12.phx.gb l... Could you use a normal asp button with postback and use the Page.RegisterSt artupScript 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.c om> wrote in message news:uf******** ********@TK2MSF TNGP11.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.
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_ClientVali date().
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\wwwr oot\aspnet_clie nt\system_web\x xxxxx
where xxxxxx is a folder name that corresponds to the version of the
..NET runtime installed.
--
mikeb
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******** ********@TK2MSF TNGP10.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_ClientVali date().
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\wwwr oot\aspnet_clie nt\system_web\x xxxxx
where xxxxxx is a folder name that corresponds to the version of the .NET runtime installed.
-- mikeb This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 inside.
<HTML>
<HEAD>
<TITLE>Test page</TITLE>
<script LANGUAGE="JavaScript">
<!--
|
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 the images.
I'd like to use the same popup window at different points throughout
the website and have the Virtual Tour (slideshow) open up at the
appropriate photos. Meaning I'd like to control which picture the
popup window opens up to,...
|
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
that works well as an html page.
It brings up a modal popup window that I have been trying to work out for
days now and this was the closest I have been able to come.
I added a little asp.net code and an asp.net button and cannot get it to
|
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 no luck
though), and searched through the IRT.ORG Faqs
(www.irt.org/script/script.htm).
The Javascript is designed to open an popup window and then inside that
window call another script which will resize that window. There may be
another...
|
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 register the
javascript code with the RegisterClientScriptBlock.
How how do I call the javascript function inside the block
from within C# asp.net page.
(yes I know popups are bad, please do not reply if you
| |
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 server side processing in Popup.aspx,
then have the popup window close, and have the
MainPage.aspx do a postback to the server. But I am
having trouble determining what client side javascript
Popup.aspx should render after it does its server side
|
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 ever I click the link button the
window pops up with the string passed to it but it gets
minimised automatically.
Even using win.focus() does'nt seem to stop it from
minimising. How can I stop this from happening
|
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 fine from a
link.
The button does bring up the popup window, but when I press the links on the
page, it doesn't return or close the window.
****************************************************************************
|
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 then saves every form
element value and reloads the page (with the 'save' being much the same as
what is achieved by an AutoPostBack="True" attribute on a web/html control).
Actually it doesn't matter which order the JavaScript or 'save'...
|
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 javascript function which calls
setTimeout and will process a second javascript function "Warn" just before
the session expires. The Warn function displays an html page with a
button. A second timer is started to cause the html page to close...
|
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 most users, this new feature is actually very convenient. If you want to control the update process,...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |