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

C

Cris Rock

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
 
E

Eliyahu Goldin

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
 
B

ben

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
 
D

Dilip Krishnan

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
 
C

Cris Rock

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top