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


Afzaal Ahmad ZeeshanRank #60 · 27.6K reputationPosted Apr 29, 2015, 3:53 AM EDT
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.
Sheikh parvazRank #9,090 · 211 reputationPosted Apr 29, 2015, 4:16 AM EDT
Kindly suggest some solution
Thanks