IF Yes i am trying that code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
function loadXMLDoc() {
alert("Your browser broke!");
var ajaxRequest; // The variable that makes Ajax possible!
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 and will update
// div section in the same page.
ajaxRequest.onreadystatechange = function () {
if (ajaxRequest.readyState == 4) {
var ajaxDisplay = document.getElementById('myDiv');
ajaxDisplay.innerHTML = ajaxRequest.responseText;
}
}
// Now get the value from user and pass it to
// server script.
var password = document.getElementById('TextBox1').value;
var email = document.getElementById('TextBox2').value;
var queryString = "?password=" + password;
queryString += "&email=" + email ;
ajaxRequest.open("POST", "Default.aspx/SaveUser", true);
ajaxRequest.send();
alert("Your bGETG!");
}
.style1
{
width: 50%;
}
.style2
{
width: 272px;
}
.style3
{
width: 272px;
height: 41px;
}
.style4
{
height: 41px;
}
Let AJAX change this text
public static void SaveUser(yu user)
{
string constr = ConfigurationManager.ConnectionStrings["ads"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand("INSERT INTO Example1 VALUES(@Password, @email)"))
{
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@Password", user.Password);
cmd.Parameters.AddWithValue("@email", user.email);
cmd.Connection = con;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
}
}
sudipta sanyalPosted May 6, 2014, 2:49 AM
http://sudiptasanyal.blogspot.in/2012/02/captch-in-aspnet.html
Sna khanPosted May 6, 2014, 12:48 AM
sudipta sanyalPosted May 5, 2014, 11:35 PM
1. write a webservice
2. call the webservice using ajax post .
for more check http://sudiptasanyal.blogspot.in/