javascript调用后台函数gridview绑定数据源后的 选中行变化问题
前台调用后台函数显示
<script language=javascript>
var a = "<%=ss()%>";
</script>
后台绑定数据源到gridview
DataTable tb1 = new DataTable();
sd1.Fill(tb1);
this.GridView3.DataSource =tb1;
this.GridView3.DataBind();
如何做才能让gridview选中新行的事件仍能取得对应数据?
protected void GridView3_SelectedIndexChanged(object sender, EventArgs e)
{ int x = GridView3.SelectedIndex;
TextBox2.Text = GridView3.Rows[x].Cells[1].Text + "(" + GridView3.Rows[x].Cells[2].Text + ")";
{
------解决方案--------------------
<%=ss()%>干什么的?你知道不知道<%=ss()%>是先于js代码先执行的?
------解决方案--------------------
你搞选中行,直接在js前台做就行了,