I have the following in my Action:
[AjaxException]
public ActionResult DoSomething(sring someParam1, string someParam2) {
//do whatever you need to do here, db etc
return new EmptyResult();
}
in my html
<form id="search-frm" name="search-frm" action="@Url.Action("DoSomething", "MyActions")" method="post" >
<input type="button" id="search-btn" value="search" class="btn" onclick="DoSomething();return false;" />
<input type="text" name="param1" id="param1" />
<input type="text" name="param2" id="param2" />
</form>
in my JS
function DoSomething() {
$("#search-frm").submit();
return false;
}
When I click on the button, and after the controller action DoSomething is done, I get redirected to MyActions/DoSomething. Is there a way to not have that w/o using jquery $.ajax? I simply need to do something and not go away from the existing page.
How to watch take a photo without a camera?. Meaningless.