i'am new in ASP.net MVC
I want to upper a popup box when i click on an Html
button , and when i confirm this Alert
i want to be redirected to a specificed Action
in my controller.
Any ideas please.
i'am new in ASP.net MVC
I want to upper a popup box when i click on an Html
button , and when i confirm this Alert
i want to be redirected to a specificed Action
in my controller.
Any ideas please.
use jQuery
, you'll need to understand Dialog
and javascript callback
methods.
Example of a user giving a text response: http://www.jquery4u.com/snippets/jquery-alert-box/
Example of a dialog box with Yes and No buttons: Yes or No confirm box using jQuery
To invoke an action on a controller you could do this, javascript:
window.location.href = "/ControllerName/DoIt?id=12345&msg=hello";
or
$.ajax( {url:"/ControllerName/DoIt",
data: "id=12345&msg=hello",
success: function (data){
}
});
Your controller method would look like this:
public ActionResult DoIt(int id, string msg )
{
.....
}