在HTML中,本来 onchange="return redir('1', unit_type);"   是正确的,现在我想将'1'替换为CS文件中的一个变量KK,改写这样:onchange="return redir(<%=kk%>, unit_type);", 但是报语法错误,请问各位大虾,正确的写法应该是怎么样的?

解决方案 »

  1.   

    KK在CS中定义为一个string类型了,,,
      

  2.   


    onchange="return redir('<%=kk%>', unit_type);", 
    这样
      

  3.   

    试试:
    onchange="return redir('<%=kk%>', unit_type);
      

  4.   

    如果用onchange="return redir('<%=kk%>', unit_type); 的话,那么,它把整个<%=kk%>作为一个参数传进去的了,而不是将它的值传进去的
      

  5.   

    redir是这样定义的:::
    function redir(type, unit_type)
    {
    location.href = "comm.aspx?type=" + type + "&unit_type="+ unit_type.value;
    }