for(var i=0; i<<%=Model.Mydatalist.Count%>;i++)
{
//then I need to pass i to Mydatalist like Model.开发者_JAVA百科Mydatalist[i]
}
//var myJSdata="<%Model.Mydatalist["&i&"]%>";
is not working.. as system see i (i's value) as a string, and will throw exception: cannot convert string to int.
You'll need to do some kind of callback to the server for that. Once the page is loaded on the browser and the script runs it is no longer running on the server so you wont be able to access your Model.Mydatalist.
精彩评论