$(function () {
$.ajax({
type: "POST",
url: "ListOfAvailableProjectforEngineer.aspx/GetAvailable",
data: "{userid:'<%=Session["userid"].ToString()%>'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess,
failure: function (response) {
alert(response.d);
},
error: function (response) {
alert(response.d);
}
});
});
function OnSuccess(response) {
var xmlDoc = $.parseXML(response.d);
var xml = $(xmlDoc);
var customers = xml.find("Table");
i = 1;
var row = $("[id*=gvViewProject] tr:last-child").clone(true);
$("[id*=gvViewProject] tr").not($("[id*=gvViewProject] tr:first-child")).remove();
$.each(customers, function () {
var customer = $(this);
$("td", row).eq(0).html(i++);
$("td", row).eq(1).html($(this).find("projectId").text());
$("td", row).eq(2).html($(this).find("ProjectTitle").text());
$("td", row).eq(3).html($(this).find("ExpectedDays").text());
$("td", row).eq(4).html($(this).find("CustomerTypeName").text());
$("td", row).eq(5).html($(this).find("CountryName").text());
$("td", row).eq(6).html($(this).find("priority").text());
$("[id*=gvViewProject]").append(row);
row = $("[id*=gvViewProject] tr:last-child").clone(true);
var autoId = $(this).find("projectId").text();
}); }
</script>
And using Webservice
[System.Web.Services.WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public static string GetAvailable(int userid)
{
DataSet ds = UserClass.LoadEngineerWithProject(userid);
return ds.GetXml();
}
but I have a problem when we navigate through next page then project id is not pass to other page .
please give me Suggestion .thanks in advance.