请问如何实现点击datagrid中的某一行,调用后台的方法? DataGrid1_SelectedIndexChanged(sender As Object, e As EventArgs) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 使用模板列,然后实现模板列控件的clicked事件! 这有个example, 你看看,private void MyGrid_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { if (e.Item.ItemIndex >= 0) { e.Item.Attributes["OnClick"] = "window.open('ModShop.aspx?shop_id=" + DataGrid1.DataKeys[(int)e.Item.ItemIndex] + "')"; } 这有个example, 你看看,private void MyGrid_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { if (e.Item.ItemIndex >= 0) { e.Item.Attributes["OnClick"] = "window.open('ModShop.aspx?shop_id=" + DataGrid1.DataKeys[(int)e.Item.ItemIndex] + "')"; } 很笨的一种办法,让button控件的背景色改为透明,不用名称,然后在javascript里调用click事件,具体实现如下:private void MyGrid_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e){ if (e.Item.ItemIndex>-1) { e.Item.Attributes.Add("onmouseover","this.setAttribute('BKC',this.style.backgroundColor); this.style.cursor='hand';this.style.backgroundColor='#dddddd'"); e.Item.Attributes.Add("onmouseout","this.style.backgroundColor=this.getAttribute('BKC');"); e.Item.Attributes.Add("onclick","javascript:GridClick();"); }}在javascript中function GridClick(){ document.Form1.Button1.click();}想在后台执行什么操作就写在button1的click事件里就行了 VSS的引用问题 如何在Handler一般处理文件获取一组的CheckBox或Radio ? 在Asp.Net中使用Mencoder将rmvb、rm等格式转化为Flv格式的问题 后台管理广告 初次使用session遇到的问题 如何写asp.net的项目文档啊 通过添加mate标签实现的网页过滤特效问题? SQL语句如何筛选出生日? datagrid控件的问题,高手帮忙看一下! 连接字符串 provider 中未知的连接选项,这是个什么错误? 各位大虾快帮帮忙啊,急,急,急,急,急、、、、、、、、、、、、 DataGrid 在打印时,如何让表头在换行时重复呢?(空)
{
if (e.Item.ItemIndex >= 0)
{
e.Item.Attributes["OnClick"] = "window.open('ModShop.aspx?shop_id=" + DataGrid1.DataKeys[(int)e.Item.ItemIndex] + "')";
}
{
if (e.Item.ItemIndex >= 0)
{
e.Item.Attributes["OnClick"] = "window.open('ModShop.aspx?shop_id=" + DataGrid1.DataKeys[(int)e.Item.ItemIndex] + "')";
}
private void MyGrid_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if (e.Item.ItemIndex>-1)
{
e.Item.Attributes.Add("onmouseover","this.setAttribute('BKC',this.style.backgroundColor); this.style.cursor='hand';this.style.backgroundColor='#dddddd'");
e.Item.Attributes.Add("onmouseout","this.style.backgroundColor=this.getAttribute('BKC');");
e.Item.Attributes.Add("onclick","javascript:GridClick();");
}
}
在javascript中
function GridClick()
{
document.Form1.Button1.click();
}
想在后台执行什么操作就写在button1的click事件里就行了