2012-05-03 43 views
0

我正在使用follwoing代码,但在我的webmethod我返回纯HTML。 contentType在这里吗?如何使用jQuery ajax调用原始HTML到ASP.net [Webmethod]

function PopulateTimetable(pGroupId) { 
        $.ajax({ 
         type: "POST", 
         cache: false, 
         url: "StudentTimetable.aspx/PopulateTimetable", 
         data: "{ 'pGroupId': '"+51+"'}", 
         contentType: "application/json; charset=utf-8", 
         dataType: "html", 
         timeout: 10000, 
         success: function(data) { 
          $("#divTimetable").removeClass("Progress");       
          $("#divTimetable").html("").append(data); 
         }, 
         error: function() { 
           $("#divTimetable").removeClass("Progress"); 
           alert("An unexpected error has occurred during processing."); 
         } 
        }); 
       } 

回答

0

我这里使用的$("#divTimetable").html("").append(data.d);,现在工作得很好

相关问题