How to return back a message after a submit

Posted by user281180 on Stack Overflow See other posts from Stack Overflow or by user281180
Published on 2010-05-10T07:20:43Z Indexed on 2010/05/10 7:24 UTC
Read the original article Hit count: 143

Filed under:

I have the following code:

 $('#change').dialog({
            autoOpen: false,
            width: 380,
            buttons: {
                "Close": function() {
                    $(this).dialog("close");
                },
                "Accept": function() {
                    var test = $("#ChangePasswordForm").submit();
                    alert(test);
                }
            }
        });

In my controller I want to return a string

  [AcceptVerbs(HttpVerbs.Post)]
    public string ChangePassword(string Name)
    {
        var msg = "Cool!";

if (name != null) return msg; }

How can I do that?

How can I dipslay

© Stack Overflow or respective owner

Related posts about asp.net-mvc