Chooriuniff
New Member
here am calling a pagemethod from jquery to serverside.and am returning a string from pagemethod to aspx page.here am storing that returned values in some var.here my method is returning values.but in frontend am getting undefined in result.here is my code.\[code\] <script type="text/javascript"> $(document).ready(function () { PageMethods.DeleteControl(onSuccess(), onError()); function onSuccess(result) { alert(result); alert(res.toString()); } function onError(error) { alert("error " + error); } });</script> [System.Web.Services.WebMethod(EnableSession = true)] [System.Web.Script.Services.ScriptMethod()] public static string DeleteControl() { BPagestyles objpage = new BPagestyles(); objpage.clubkey = 16; DataTable dt = objpage.fill(); string style = ""; foreach (DataRow dr in dt.Rows) { style +=","+ dr["MenuTextStyle"].ToString(); style +="," +dr["MenuBackcolor"].ToString(); style +="," +dr["MenuTextcolor"].ToString(); style += "," + dr["NavigatioinTextStyle"].ToString(); style += "," + dr["NavigationBackcolor"].ToString(); style += "," + dr["NavigatioinTextcolor"].ToString(); style += "," + dr["NavigatioinTextsize"].ToString(); } return style; }\[/code\]