aspx传值
我在*.aspx.cs中定义了一个 “private string[] dbname = { "DS-001", "DS-002", "DS-003" };“数组,我想在*.aspx中的js里面用,请问我该怎么把值传过去?能用get/set封装吗?
------解决方案--------------------refer:http://blog.csdn.net/heyt860921/article/details/5871088
------解决方案--------------------
.CS:public string dbname1 = "[ \"DS-001\", \"DS-002\", \"DS-003\" ]";
.ASPX:
var testArray = <%=dbname1%>;
for(var i=0;i<testArray.length;i++)
{
alert(testArray[i]);
}
------解决方案--------------------参考这个文章:http://www.cnblogs.com/ymj126/archive/2012/06/14/2549467.html