<script language="javascript" type="text/javascript">
    function openModalDialog(strurl)
    {
         //alert("hao"); 
         var returnValue=showModalDialog("WorkflowTransferPage.aspx?workitemid=" +strurl,"","dialogWidth:750px;dialogHeight:550px;status:'yes'"); 
         window.location.reload();//模态窗口关闭后刷新
    }
    </script>    这是javascript函数,打开一个模态窗口,strurl保存的是参数值。在gridview模板列有一个按钮,
OnClientClick='return openModalDialog(<%# DataBinder.Eval(Container.DataItem,"DOCUMENTID"%>)'这个strurl是从gridview中获取的,我试用了这样的绑定方式对应的页面
onclick="return openModalDialog(&lt;%# DataBinder.Eval(Container.DataItem,&quot;DOCUMENTID&quot;%>);" style="height:16px;width:16px;border-width:0px;" 也就是说(<%# DataBinder.Eval(Container.DataItem,"DOCUMENTID"%>)没有起作用,该怎么办啊?

解决方案 »

  1.   

    <%# DataBinder.Eval(Container.DataItem,"DOCUMENTID"%>
    re:
    这是个什么?它会返回什么?
      

  2.   

     function openModalDialog(strurl) 
    里面 的 alert("hao");  执行吗执行的话 alert(strurl) 看看是什么
     window.location.reload();// 这句注释了OnClientClick='return openModalDialog( <%# DataBinder.Eval(Container.DataItem,"DOCUMENTID"%>)'   return  去掉先自己调试下
      

  3.   


    不行,直接就显示语法错误,因为在客户端页面对应的OnClientClick='return openModalDialog( <%# DataBinder.Eval(Container.DataItem,"DOCUMENTID"%>)'代码是
    onclick="return openModalDialog(&lt;%# DataBinder.Eval(Container.DataItem,&quot;DOCUMENTID&quot;%>);" style="height:16px;width:16px;border-width:0px;" 可能是编译的时候就把<%# DataBinder.Eval(Container.DataItem,"DOCUMENTID"%>当成参数了,而不是数据绑定
      

  4.   

    OnClientClick="openModalDialog('<%#Eval("DOCUMENTID") %>')"
    改成这样了,显示服务器格式不正确