日期:2014-05-18 浏览次数:20448 次
function loadPage() { var ids=""; var count=parseInt("<%=GVW_Dev.Rows.Count %>"); for(var i=0;i<count;i++) { //这里可以获得 ids+="<%=GVW_Dev.DataKeys[0].Value.ToString() %>"+","; //这里报错:与System.Web.UI.WebControls.DataKeyArray.this[int]最匹配的重载方法具有一些无效参数 ids+="<%=GVW_Dev.DataKeys["+i+"].Value.ToString() %>"+","; } alert(ids); }
public string showdatakeys() { string s1 = string.Empty; int count = this.GridView1.Rows.Count; for (int i = 0; i < count;i++ ) { s1 += this.GridView1.DataKeys[i].Value.ToString(); } return s1; }