Hi,
I have an array in asp.net in page_load method which I want to pass to javascript :
C#:
EmpDBClass empobj = new EmpDBClass();
DataTable dtCheckValue = empobj.dtGetDataTable("EPS_GetBookedValues");
var bookedarray = dtCheckValue.AsEnumerable().Select(r => r.Field("Name")).ToArray();
javascript:
var bookedSeats = <%new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(this.bookedarray);%>
problem is Bookedarray can not be found .
Kindly help

Sheikh parvazPosted Apr 29, 2015, 8:16 AM
Kindly suggest some solution
Thanks
Afzaal Ahmad ZeeshanPosted Apr 29, 2015, 7:53 AM
I can suggest that you debug your application by setting a breakpoint at this spot. Anyways, make sure that your variable is public, member variable (directly under class and not under any function) and is get-able. Then re-try this same procedure.