2

I have a DataTable in PageLoad, I need to pass to it to a JQuery file to generate the BingMap contents

 protected override void OnLoad(EventArgs e)
 {
    DataTable dt = dtLocations;
 }

my JQuery file is Included in .ascx page

<script type="text/javascript" src="/script/BingMap/BingMapJS.js" ></script>

Need to send this "dt" to JQuery file

Manish Mishra
  • 12,163
  • 5
  • 35
  • 59
Rahamath
  • 43
  • 3

2 Answers2

2
string json = JsonConvert.SerializeObject(table);

http://james.newtonking.com/projects/json/help/index.html?topic=html/T_Newtonsoft_Json_JsonConvert.htm

Roar
  • 2,117
  • 4
  • 24
  • 39
0

Most of jQuery libraries accept Json as data format to process, you can follow this approach to convert your DataTable into Json result and then pass that to Bing JS library to process.

Community
  • 1
  • 1
Nexus23
  • 6,195
  • 9
  • 50
  • 67