string ss="";  
public bool setSession(string strid)
        {
            bool judge = false;
            if (strid== null)
            {
                ss= strid;
                judge = true;
            }
            return judge;
        }
在javascript中怎么调用
 var judge = "<%=setSession(\""+str+"\") %>";
            alert(judge)
我这样写为什么有错呢??

解决方案 »

  1.   


    http://blog.csdn.net/porschev/archive/2010/10/15/5943579.aspx
      

  2.   

    protected string str(string name)
      {
      return =name;
      }  
    function dd(name)
    {
      ajax请求url="a.aspx?name=" + name
      成功后,执行document.getElementById("<%=txtBox1.ClientID%>").value=httpAjax.responseText;
    }
    if(Request.QueryString["name"]!=null)
    {
    Response.ClearContent();
    Response.Write(str(Request.QueryString["name"]));
    Response.End();
    }
      

  3.   

    用Ajax异步调用cs中的方法
    UpdatePanel
      

  4.   

    ajax可以,给你一个jquery的ajax 调用后台代码的例子:
    http://www.cnblogs.com/chenping-987123/archive/2010/10/11/1848182.html