0

Hi there,

I am using a javascript command to show a message box in my web application since the MessageBox.Show() command won't work. The message box appears, however, it seems like it has navigated out of the web application showing the default grey background.

How do I modify the code so that the message box appears in the same page where the rest of the information is.

Response.Write(@"<script language='javascript'>alert('This field cannot be empty')</script>");

Moreover, each time I click a button or the calendar at the bottom of the page, I get moved upwards, at the top part of the web app and away from the button in question.

Thank you in advance.

Kind Regards,

croussou

3
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by croussou
0

So you want your alert box to be part of the page, not above it like the javascript alert box? You can do this by either including a div with the error message in your page and either:
- toggling it visibility will you want it to display

- initially placing it off screen through it x coordinates and moving it into the correct location when you want to display it.

This of course assuming a label with text won't suffice for what you need. For highlighting inputs that are required you can always use required field validators placed beside the input.

0

Thank you for the replies guys, much appreciated.

Kind Regards,

croussou

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.