<asp:HyperLink Text="修改" NavigateUrl="javascript:void(window.showModalDialog('Bmxg.aspx?m=0&type=+DataBinder.Eval(Container.DataItem,'编号').ToString()','','width='+screen.width+',height='+screen.height+',scrollbars=yes,toolbar=no, menubar=no, resizable=yes,top=0,left=0,fullscreen=0'));" runat="server" ID="Hyperlink1"/>
这么写就错误
像下面这么写就没错误
<asp:HyperLink Text="修改" NavigateUrl="javascript:void(window.showModalDialog('Bmxg.aspx?m=0&type=g','','width='+screen.width+',height='+screen.height+',scrollbars=yes,toolbar=no, menubar=no, resizable=yes,top=0,left=0,fullscreen=0'));" runat="server" ID="Hyperlink1"/>怎么改

解决方案 »

  1.   

    用<a 就好,  
      <a href="javascript:OpenWindow('<%#DataBinder.Eval(Container.DataItem,'编号')%>');">
        
      </a><script type="text/jscript">
        function OpenWindow(type)
        {
            window.showModalDialog('Bmxg.aspx?m=0&type='+type,'','width='+screen.width+',height='+screen.height+',scrollbars=yes,toolbar=no, menubar=no, resizable=yes,top=0,left=0,fullscreen=0'); 
        }
    </script>
      

  2.   

    <asp:HyperLink Text="修改" NavigateUrl=<%#("javascript:void(window.showModalDialog('Bmxg.aspx?m=0&type=" + Eval("编号") + "','','width='+screen.width+', height='+screen.height+', scrollbars=yes, toolbar=no, menubar=no, resizable=yes,top=0,left=0,fullscreen=0'));)%> runat="server" ID="Hyperlink1"/>
      

  3.   

    支持二楼的,方法如下:
     <a class=a1 href='#' onclick=showNewDialog("../Main/Affiche.aspx?ID=<%# DataBinder.Eval(Container.DataItem,"id") %>")>  function showNewDialog(url)    
        {        
            var s=location.search 
            var newurl=url+"&"+s.substr(1,s.length).split("&")+"&"+s.substr(2,s.length).split("&")        n=window.showModelessDialog(newurl,'Dialog Arguments Value','dialogHeight: 500px; dialogWidth: 500px; center: yes; help: no;status:no');
            window.opener=null;
        }
      

  4.   


    <asp:HyperLink Text="修改" NavigateUrl="javascript:void(window.showModalDialog('Bmxg.aspx?m=0&type=<%#DataBinder.Eval(Container.DataItem,'编号')%>','','width='+screen.width+',height='+screen.height+',scrollbars=yes,toolbar=no, menubar=no, resizable=yes,top=0,left=0,fullscreen=0'));" runat="server" ID="Hyperlink1"/> 
    这么写