Hi
I am trying to stop my form from submitting yet I never can get it work and always end up changing it to a button type. However I want to see if I keep the submit button as is if I can have in my Asp.net mvc application as a FormCollection Paramater.
Yet I can't even try really passing in anything until I get it to stop submitting. I don't know why I can't get it work
View
$(function()
{
$("#Submit1").submit(function(e)
{
$.post("Page1", function(e)
{
alert("alert");
});
return false;
});
});
<% using (Html.BeginForm("Page1","Home",FormMethod.Post,new {@id = "mytest" }))
{ %>
<%= Html.TextBox("test","hi") %>
<input id="Submit1" type="submit" value="submit" />
<% } %>
Controller Method
public bool Page1()
{
return false;
}