hi friendz,
if u want your database driven website to be fast u need to follow this way of structure.
Code on page1.aspx
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function sendReferAFriendEmail() {
var ajaxRequest; // The variable that makes Ajax possible!
var isFound;
try {
// Opera 8.0+, Firefox, Safari
ajaxRequest = new XMLHttpRequest();
} catch (e) {
// Internet Explorer Browsers
try {
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
ajaxRequest = new
ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
// Something went wrong
alert("Your browser broke!");
return false;
}
}
}
// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function () {
if (ajaxRequest.readyState == 4) {
alert(ajaxRequest.responseText);
}
else {
}
}
var sName =
document.getElementById("txt_1").value + "#" +
document.getElementById("txt_2").value + "#" +
document.getElementById("txt_3").value;
var url = "page2.aspx?fe=" +sName;
ajaxRequest.open("POST", url, true);
ajaxRequest.send(null);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table width="250" border="0">
<tr>
<td><input type="text" name="txt_1" id="txt_1" /></td>
</tr>
<tr>
<td><input type="text" name="txt_2" id="txt_2" /></td>
</tr>
<tr>
<td><input type="text" name="txt_3" id="txt_3" /></td>
</tr>
<tr>
<td><input type="text" name="txt_4" id="txt_4" /></td>
</tr>
<tr>
<td><input name="buton" id="buton" onclick="sendReferAFriendEmail();" type="submit" /></td>
</tr>
</table>
</div>
</form>
</body>
</html>
<head runat="server">
<title></title>
<script type="text/javascript">
function sendReferAFriendEmail() {
var ajaxRequest; // The variable that makes Ajax possible!
var isFound;
try {
// Opera 8.0+, Firefox, Safari
ajaxRequest = new XMLHttpRequest();
} catch (e) {
// Internet Explorer Browsers
try {
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
ajaxRequest = new
ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
// Something went wrong
alert("Your browser broke!");
return false;
}
}
}
// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function () {
if (ajaxRequest.readyState == 4) {
alert(ajaxRequest.responseText);
}
else {
}
}
var sName =
document.getElementById("txt_1").value + "#" +
document.getElementById("txt_2").value + "#" +
document.getElementById("txt_3").value;
var url = "page2.aspx?fe=" +sName;
ajaxRequest.open("POST", url, true);
ajaxRequest.send(null);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table width="250" border="0">
<tr>
<td><input type="text" name="txt_1" id="txt_1" /></td>
</tr>
<tr>
<td><input type="text" name="txt_2" id="txt_2" /></td>
</tr>
<tr>
<td><input type="text" name="txt_3" id="txt_3" /></td>
</tr>
<tr>
<td><input type="text" name="txt_4" id="txt_4" /></td>
</tr>
<tr>
<td><input name="buton" id="buton" onclick="sendReferAFriendEmail();" type="submit" /></td>
</tr>
</table>
</div>
</form>
</body>
</html>
on page2.aspx catch data by query-string and save data.to pass a flag message Response.Write("Done successfully");eliminate all the html tage on page two other wise it show those on the message
No comments:
Post a Comment