绑定了一个HyperLink控件
NavigateUrl="javascript:varwin=window.open('<%# Eval("EmpID", "EmpDetails.aspx?EmpID={0}") %>',null,'width=300,height=200');window.Close();"老是提示服务器语法有错!想请教老鸟们哪里写错了,或者提供新的代码?
效果是这样的:gridview 点击详细弹出一个显示详细页面的对话框,我用三层做的需要这个页面传一个EmpID值给详细页面。 

解决方案 »

  1.   


     string ulScript = string.Format("JavaScript:ymPrompt.win('{0}','850','575', '新增客户消息记录', null, null, null, true);", "../../ByCustomerInfo.aspx?customerID=" + iCustomerID);
            this.HLEditCustomerInfo.Attributes["onclick"] = ulScript;
            this.HLEditCustomerInfo.NavigateUrl = "#";
      

  2.   

     NavigateUrl="" 改成单引号
      

  3.   

     NavigateUrl='javascript:window.showModalDialog("EmpDetails.aspx?EmpID=<%#Eval("EmpID","{0}")%>","","dialogWidth=200px;dialogHeight=100px");'
      
      

  4.   

    NavigateUrl=\"javascript:varwin=window.open('<%# Eval("EmpID", "EmpDetails.aspx?EmpID={0}") %>',null,'width=300,height=200');window.Close();\"
      

  5.   

    NavigateUrl=@"javascript:varwin=window.open('<%# Eval("EmpID", "EmpDetails.aspx?EmpID={0}") %>',null,'width=300,height=200');window.Close();"
      

  6.   

    NavigateUrl=\"javascript:varwin=window.open('<%# Eval(\"EmpID\", \"EmpDetails.aspx?EmpID={0}\") %>',null,'width=300,height=200');window.Close();"