01.public void ProcessRequest (HttpContext context) {
02. if (context.Session["UserId"] != null)
03. {
04. ProductInfo _ProductInfo = new ProductInfo();
05. _ProductInfo.UserId = Convert.ToInt32(context.Session["UserId"]);
06. var _ProductList = _ProductInfo.GetServiceByUserId();
07. var serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
08. HelperFunctions.InitializeCulture();
09. var result = new
10. {
11. iTotalRecords = _ProductList.Count(),
12. iTotalDisplayRecords = _ProductList.Count(),
13. aaData = _ProductList.Select(p => new object[] { p.SN, p.ProductName, p.CategoryName, string.Format("<a href=\"#\" title=\"{0}\" class=\"product-view\">{0}<a>|{2}<a href=\"#\" title=\"{1}\" class=\"delete-icon product-delete\">{1}</a>", Resources.Language.View, Resources.Language.Delete, !p.Approved ? string.Format("<a href=\"#\" title=\"{0}\" class=\"product-edit\">{0}</a>|", Resources.Language.Edit) : string.Empty), p.ProductId })
14. };
15. var json = serializer.Serialize(result);//Serialize result to jSon format
16. context.Response.ContentType = "text/plain";//Data return type is JSon here
17. context.Response.Write(json);//Returns Json
18. }
19. else {
20. context.Response.Write(false);
21. context.Response.Write("You are not register as a consultant to view the service page.</br>");
22.
23. }
24.
25. }
I got the error on the line 02.