Hi I have a two aspx file, one of them Default.aspx and other is Insert.aspx .
Insert.aspx expects two parameter named firstname and lastname, and saved these values to the database,and writes a welcome message like 'Welcome John Stinger'.
Default.aspx contains a simple form , two textbox and one button (txtFname, txtLname,btnInsert) and a div to show message.
I write a JQuery code in Default.aspx :
<script type="text/javascript">
$(document).ready(function() {
$('#btnInsert').click(function() {
$.ajax({
contentType: "text/html; charset=utf-8",
data: "firstname=" + $('#txtFname').val() + "&lastname=" +$("#txtLname").val(),
url: "Insert.aspx",
dataType: "html",
success: function(data) {
$("#message").html(data);
}
});
});
});
</script>
I want to get Insert.aspx page and load it into #message div but i cant get the page. What can i do?
Thanks..