TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Chinna Netha
NA
282
138.1k
jQuery AJAX call not working when URL Routing is used in web
Jul 22 2015 1:15 AM
Jquery ajax call not working when URL Routing is used in asp.net web forms
$("#fb_submit").bind("click", function () {
var fb_login_users = {};
fb_login_users.email = $("#fb_email").val();
fb_login_users.id = $("#fb_id").val();
$.ajax({
type: "POST",
url: '<%=Page.ResolveClientUrl("~/user.aspx/controlfb") %>',
data: '{email: "' + user.email + '" }',
data: '{id: "' + user.id + '" }',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
alert("User has been added successfully.");
}
});
return false;
});
[WebMethod]
[ScriptMethod]
public static void fb_user(users users)
{
string contr = ConfigurationManager.ConnectionStrings["con"].ConnectionString;
using (SqlConnection con = new SqlConnection(contr))
{
using (SqlCommand cmd = new SqlCommand("insert into fb_users values(@email,@id)"))
{
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@email", users.email);
cmd.Parameters.AddWithValue("@id", users.id);
cmd.Connection = con;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
}
}
Reply
Answers (
7
)
grouping listview
Asp.net