2
using (DataServer server = new DataServer())
        {
            server.ExecuteNonQuery(CommandType.Text, updateuser, param);
        }
        MessageBox.Show("User succesfully updated");

I have a update button when The fields are updated I show a message box, but the problem is the message box is behind the browser. I have to minimize the browser to close the message box, at the same time I am able to navigate in the website without closing the message box, I want to blur out the remaing area in the website when the message box is displayed. How can I do this in my website.


1
  • 2
    you need to use a custom javascript message box(alert) for this.not a message box... Commented Sep 27, 2011 at 22:18

2 Answers 2

4

In this case you would either want to throw up an alert with JavaScript, or use a dialog of some sort.

To throw up an alert, you can do this:

Page.ClientScript.RegisterStartupScript(GetType(), "UserDialogScript", "alert(\"User successfully updated\");", true);

As for using a dialog, I would suggest the ModalPopupExtender or the jQuery UI Dialog.

ModalPopupExtender:
http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/modalpopup/modalpopup.aspx

jQuery UI Dialog:
http://jqueryui.com/demos/dialog/

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks that worked. I am using this message box for the pop up i do with the modalpopup
2

Don't do it this way. Instead, emit client side JavaScript to pop up an alert dialog, or add a div that a user can click to make it go away. You can also use a more proper UX convention of adding a message div that simply states "record updated" or similar, in a very specific color, so the user knows what to look for.

The idea of popping up a message box sounds tempting, but stick this out on a server and hit it from a browser on a separate box and you will quickly find out why this is an extremely bad idea.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.