I am trying to submit an asp.net form (Default1.aspx) using jquery $.post() however I am unable to post to the other page (Test1.aspx). Here's what I have written
$("#Button1").click(function(e) {
var t1 = $('#txt1').val();
var t2 = $('#txt2').val();
$.post('Test1.aspx', { text1: t1, text2: t2 }, function(result) {
alert(result);
});
return false;
});
Markup is as here:
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txt1" runat="server">
</asp:TextBox>
<asp:TextBox ID="txt2" runat="server">
</asp:TextBox>
<asp:Button ID="Button1" runat="server"
Text="Submit" />
</div>
</form>
</body>
How can i write the code to submit for using $.post() and read values on Test1.aspx. Can you give a working example.
UPDATE: I do not have a problem reading the values..the issue is the page is not navigating to Test1.aspx.