怎么在gridview 的列的名称做一个连接?鼠标经过时连接的名称颜色改变?求代码。

 我来答
手机用户76229
2013-11-29 · TA获得超过149个赞
知道答主
回答量:121
采纳率:100%
帮助的人:133万
展开全部
<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");////设置悬浮鼠标指针形状为"小手"
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式