返回首页

大家好,

我有我的Default.aspx页面的jQuery代码:


 

 <script src="js/jquery-1.4.1.min.js" type="text/javascript"></script>

   <script type="text/javascript">

 

        $(document).ajaxError(function(){

            if (window.console && window.console.error) {

                console.error(arguments);

            }

        });

 

        $(document).ready(function () {

 

            var msgbox = $("#status");

 

            $("#Button1").click(function () {

 

                $.ajax({

 

                    type: "POST",

                    //Page Name (in which the method should be called) and method name  

                    url: "Default.aspx/GetDateVal",

                    // If you want to pass parameter or data to server side function you can try line  

                    //data: "{'args':'Pankaj'}",  

                    //else If you don't want to pass any value to server side function leave  

                    data: "{}",

                    contentType: "application/json; charset=utf-8",

                    dataType: "json",

                    success: function (msg) {

                        //Got the response from server and render to the client  

                        msgbox.html(msg.d);

 

                    }

 

                });

 

            });

 

        });  

 

 </script>

 


我有下面的代码,在代码隐藏类:

{C}
从VS2010的,即本地主机上运行时,这工作很细。我没有得到结果返回日期字符串如预期,但在localhost上运行时,从VS2003的方法?

有谁知道为什么会这样呢?

谢谢。

回答

评论会员: 时间:2