I am going to ask the dumnest question ever. I am creating a C# ASP.Net MVC4 application. I want a button on the index page that will shut the application down and close the browser. How do I do it? I currently have the following code snippet in my Index.cshtml to give a button:
@using (Html.BeginForm("CloseApplication", "Home", FormMethod.Post))
{
<input id="close" name="closeButton" type="submit" style="width:170px" value="Close Application" />
}
I am going to a CloseApplication ActionResult method in my HomeController.cs which currently looks like:
public ViewResult CloseApplication()
{
// Something to do here I think
return null;
}
What do I do here?
Am I over complicating things?
Many thanks to all of you who contribute regularly and help us out.