how to wrap parameters with Data attribute from ajax get call
please look at the code below. the web method is not firing when i wrap "data" attribute in double quotes(" ")
like [ data: " { 'Name' : '4' } " ] in ajax call. am wrapping in quotes because i have to pass textbox data dynamically.let me know the reason pls.
$('#txt').keypress(function () {
var date1 = $('#txt1').datepicker().val();
var x = 10;
$.ajax({
type: "GET",
url: "school.aspx/GetEmployees",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: "{'name':'"+date1+"'}", [Note: it is working like this( { ' Name ' : ' 3 ' } )
success: function (data) {
$("#gvEmployees").empty();
}
});
});