I came across this plug in: http://malsup.com/jquery/form/#getting-started
I was wondering how can I use this in asp.net webforms?
What do I replace action="comment.php"
with? Webmethod?
ASPX:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://malsup.github.com/jquery.form.js"></script>
<script type="text/javascript">
$(document).ready(function () {
// bind 'myForm' and provide a simple callback function
$('frmMaster').ajaxForm(function () {
alert("Thank you for your comment!");
});
});
</script>
<form id="myForm" action="Default.aspx/UPLOAD" method="post">
Name: <input type="text" name="name" />
Comment: <textarea name="comment"></textarea>
<input type="submit" value="Submit Comment" />
</form>
</asp:Content>
CODE BEHIND:
[WebMethod]
public string UPLOAD(HttpContext context)
{
return "test";
}
NOTE: I am using masterpage.