<a href=# onclick="<%#runthis()%>">aaa</a>

解决方案 »

  1.   

    <a href=# onclick="return runthis();">aaa</a>
      

  2.   

    將runthis()定義成public
    <a href=# onclick="<%#runthis()%>">aaa</a>
      

  3.   

    我是这样写的
    Response.Write("<a id='del' style='cursor:hand;' onclick='<%#delit()%>'>删除</a>");
    怎么不行啊?
      

  4.   

    把名字空间写全应该可以的!
    Response.Write("<a id='del' style='cursor:hand;' onclick='<%#yourNameSpace.yourClassName.delit()%>'>删除</a>");
    delit声明为public
      

  5.   

    还是不行,我的函数是这样写的:
    public void delit()
    {
    Response.Write("<script>alert('sdaf')</script>");
    Response.Redirect("sadf.asp");
    }
    想如果点删除之后先弹出alert,然后再跳转页面。
      

  6.   

    public void delit()
    {
                   Response.Write("<script>window.alert('sdaf');window.location("sadf.asp");")</script>
    }
      

  7.   

    打错了。
    Response.Write("<script>alert('sdaf');window.location:"sadf.asp"</script>");
      

  8.   

    其实这两个函数并不是我想要的,
    我只是想知道delit()是否被调用
    但是改过函数之后还是没有反映,
    说明函数delit()并没有被调用啊~~