本帖最后由 free1985 于 2012-10-31 09:48:43 编辑

解决方案 »

  1.   

    本人新手,请给予具体代码示例指导,代码片段、demo或博客链接,谢谢。本人邮箱:[email protected]
      

  2.   

    namespace WebApplication1
    {
        [AjaxNamespace("hehe")]
        public partial class WebForm1 : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                AjaxPro.Utility.RegisterTypeForAjax(typeof(WebForm1));        }
            [AjaxPro.AjaxMethod]
            public object GetDate()
            {
                return Session["name"];
              
               
            }
        }}
    前台JS
      var da= hehe.GetDate().value;
    web.config要加句话<httpHandlers>
      <add verb="*" path="*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2" />
      </httpHandlers>在在项目中添加ajaxpro.2.dll的引用
      

  3.   

    在cs中用[webmethod]标注获取session值的方法,前台用jquery的ajax获取,这样应该可以的
      

  4.   

    <%= Session["KEY"] %> 就可以了 何必用 AJAX
      

  5.   

    js与cs之间的交互只能能过get,post来完成例如getSession.aspx?key=...Response.Write(Session[Request["key"]]);
    ...
    <script>
    var test="kk";
    jQuery.get('getSession.aspx?key='+ test,'',function(data){...});
    </script>
      

  6.   

    可以使用cookie解决.
    后台写cookie的代码如下:
    Response.Cookies["ID" + i.ToString()].Value = "test" + i.ToString(); 前台读cookie的代码如下:
    var arr = document.cookie.match(new RegExp("(^| )"+szTemp+"=([^;]*)(;|$)"));
                   if(arr != null)
                   {
                        document.getElementById("Label1").textContent = arr[2];
                   }
     
      

  7.   

    http://topic.csdn.net/u/20101124/21/dc9f7a11-b4e1-4099-923c-895b2fb1d83d.html