
怎么在gridview 的列的名称做一个连接?鼠标经过时连接的名称颜色改变?求代码。
1个回答
展开全部
<asp:LinkButton id="lbId" OnClientClick="ShowEditDPSN(this)" runat="server"
CommandName="Transfer" ImageUrl="~/images/1.gif" Text='<%# DataBinder.Eval(Container, "DataItem.DPAuthorName") %>' ></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>js方法function ShowEditDPSN(obj)
{ var strDPSN=obj.value;
var strMsg= window.showModalDialog("EditDPSnLimite.aspx?intValue=1&DPSNInfo="+escape(strDPSN),"","dialogHeight:300px; dialogWidth:450px; status:no; help:no; scroll:no");
}.cs代码在gridview 的RowDataBound事件中操作 LinkButton lb = (LinkButton)((System.Web.UI.WebControls.TableRow)(gv)).Cells[5].FindControl("lbID"); lb.Attributes.Add("value", strName);strName是超链接传得参数 鼠标事件GridView1_RowDataBound事件中//当鼠标停留时更改背景色
e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#F1F0F1'");
////当鼠标移开时还原背景色
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");////设置悬浮鼠标指针形状为"小手"
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询