Fork me on GitHub
    <script type="text/javascript">
        function login() {
            var sa = WebForm1.Hello().value;
            $("#inputT").attr("value", sa);
            var sa2 = WebForm1.Hello2().value;
            $("#Text2").attr("value", sa2);
            var s1 = WebForm1.Hello1().value;
            var s11 = eval(s1);
            alert(s11[0]);
        }
    </script>
 [Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)]
         public string Hello1()
         {
             return "[5,4,3,2,1]";//这种可以
             //return " ";
         }

 

protected void Page_Load(object sender, EventArgs e)
        {
            Ajax.Utility.RegisterTypeForAjax(typeof(WebForm1));
        }
       [Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)]
        public string GetQuYu2(string name)
        {}

 

posted on 2014-03-10 01:21  lingfeng95  阅读(837)  评论(0编辑  收藏  举报