For the simple validation you describe below, client side validators and
simple javascript may be sufficient. However, in our case, when we needed to
communicate back from the server to the client via a popup "alert", we wrote
a javascript function to call a standard html page that would become the
popup (so it could inherit the stylesheets and not just be a basic alert
box) and then on the main page, we placed a hidden text control.
The text control was unpopulated the first load. On submit, if no message
was needed, the textbox was still left empty. But if we needed to
communicate back, we populated the textbox with a message string from the
server that the onload() could see a) textbox isn't empty, so I need to
initiate the message popup and b) parse the hidden textbox to pull out the
values. The Javascsript function then opened the window, passing the
appropriate values it got from the textbox in the querystring to the message
page. Voila, customized, stylesheet driven alert boxes.
You can take it a step further and allow the popup to communicate back to
the parent then (for example, you might want an OK and CANCEL) so that the
main page can make some response to the user decision. We standardized
that HTML/Javascript function to give most of the standard responses of a
regular message box (OK only, OK/CANCEL, YES/NO, etc.)
It's a pain in the you know what to get it built and hooked up the first
time, but then it's the same thing over and over again when ever you need
it. Put the javascript in a #include and you won't have to be rewriting that
on each aspx/html page.
Todd
"PH" <p_*******@yahoo.com> wrote in message
news:c5**************************@posting.google.c om...
Does anyone know how to have the pop-up javascript alert,
Response.Write("<script language=javascript>alert('HEY!');</script>);
, pop-up after the page has been posted back? I am pressing a button,
validating data and then wanting to simply pop-up an alert if say the
login is empty. When I click the button though the page is blank but
the pop-up is there.