I have the code below which i am running, i would like to move to another page once it is successful, tring to make the url in c# and when returned u can see the the string ic changed what can be done.
C# Code
[System.Web.Services.WebMethod]
public static string timeFinished()
{
string url = "Summary.aspx?subjectid=" + HttpContext.Current.Session["subjectid"].ToString() + "&chapterid=" + HttpContext.Current.Session["chapterid"].ToString();
return url;
}
Returned from Ajax
{"d":"Summary.aspx?subjectid=564\u0026chapterid=564
Ajax Java Scrpit
$.ajax({
type: "post",
url: "testchapter.aspx/timeFinished",
contentType: "application/json; charset=utf-8",
dataType: "text",
success: function (result) {
//
window.location = result;
}
});
Given that the resulting data is proper json, maybe you could try the following script:
$.ajax({
type: "post",
url: "testchapter.aspx/timeFinished",
contentType: "application/json; charset=utf-8",
dataType: "json", // change to json here!
success: function (result) {
window.location = result.d; // result is a JS object; access the d property
}
});