问题描述
原来在gridview中写的绑定跳转是<asp:TemplateFieldHeaderText="打印退休证"ItemStyle-HorizontalAlign="center"><ItemTemplate><ahref='../Common/SheetPages/TXZ_1.aspx?id=<%#hr.comm.DESENcrypt.Encrypt(Eval("id").ToString())%>'target="_blank"style="text-decoration:none">打印</a></ItemTemplate></asp:TemplateField>
现在想通过前台js方式实现跳转<scriptlanguage="JavaScript"type="text/javascript">functionqm(){vara=window.showModalDialog('../Common/SheetPages/TXZ_1.aspx?id=<%#hr.comm.DESENcrypt.Encrypt(Eval("id").ToString())%>',window,'center:yes;scroll:no;toolbar=no;status:no;resizable:no;help:no;unadorne:yes;dialogHeight:700px;dialogWidth:1100px');if(a)location.href='PrintPreview.aspx';returnfalse;}</script>
希望的功能就是,a标签或者button都行只要采用前台js绑定这种页面跳转就行
解决方案
解决方案二:
js:$("#GridLista").bind("click",function(){varid=$(this).attr("id"); 然后就是qm()方法体中的内容,});#GridList指的是GridView的ID属性。<ItemTemplate><aid="绑定id">修改</a></ItemTemplate>