all groups > asp.net > february 2004 >
You're in the

asp.net

group:

Displaying the message in ASP.Net application.....


Displaying the message in ASP.Net application..... Cris Rock
2/10/2004 11:44:02 PM
asp.net:
In my ASP.Net application, validation rule demands that user has to select
one of the option buton(...WebControls.RadioButton).
I am doing these kind of validations in the server side when the user clicks
on the update button(...webControls.Button). My problem is how to display
this message to the end user. In a traditional desktop apllication i can
display the message usig message functions or modal forms. How to inform the
user that the validations got failed ?
Cris Rock

Re: Displaying the message in ASP.Net application..... skchbs NO[at]SPAM yahoo.com
2/11/2004 6:42:28 AM
hi Cris,
I m not sure i understood ur issue correctly, but i think u wanna
display a message box on the client? if yes......i had the same issue
and the code i used is as follows

Response.Write("<script>window.alert('Your message here')</script>");

HTH,
Ben

[quoted text, click to view]
Re: Displaying the message in ASP.Net application..... Dilip Krishnan
2/11/2004 9:49:56 AM
Cris, Its easy to do it RequiredFieldValidation Control. However if you
want to do a validation on the server side and display a message... your
best option is to set a client side variable with a message to be
displayed in the Onload of a page and then have a client side jscript
function that displays this message in an alert
Hope that helps

[quoted text, click to view]

--
Regards,
Dilip Krishnan
Re: Displaying the message in ASP.Net application..... Eliyahu Goldin
2/11/2004 11:38:37 AM
If you want to produce a message in a modal dialog, use client-side
JavaScript function window.alert (...). Alternatively, you can allocate an
invisible area for messages on your web form and make it visible on server
side when you want to display a message.

Eliyahu

[quoted text, click to view]

Re: Displaying the message in ASP.Net application..... Cris Rock
2/11/2004 11:54:25 PM
Ben,
Thanks for the solution.
I slightly modified the syntax.
Here it is....
Response.Write("<script>window.alert('your message here')</script>;")

The poblem here is, after the message, the rendered page will have ";"
character at the top of the page.
any thought on this ?
I appreciate your earlier thoughts on this.
Cris





[quoted text, click to view]

AddThis Social Bookmark Button