大侠们:  
AjaxPro在.net2005已经换成支持net2.0的版本,运行ch51.Tree.GetSubCategory(iCategoryID,  GetSubCategory_callback);调试过程中没进入断点,但在.net2003顺利通过,这是怎么回事?  
 
前台javaScript脚本:  
function  ExpandSubCategory(iCategoryID)  
{  
var  li_father  =  document.getElementById("li_"  +  iCategoryID);  
if  (li_father.getElementsByTagName("li").length  >  0)  //分类已下载  
{  
           ChangeStatus(iCategoryID);  
           displayDocList(iCategoryID);  
           return;  
}  
 
li_father.className  =  "Opened";  
 
switchNote(iCategoryID,  true);  
ch51.Tree.GetSubCategory(iCategoryID,  GetSubCategory_callback);                                                  
}  
//*************************************************  
function  GetSubCategory_callback(response)  
{  
           var  dt  =  response.value.Tables[0];  
           if  (dt.Rows.length  >  0)  
           {  
                       var  iCategoryID  =  dt.Rows[0].FatherID;  
           }  
           var  li_father  =  document.getElementById("li_"  +  iCategoryID);  
           var  ul  =  document.createElement("ul");  
           for  (var  i  =  0;i  <  dt.Rows.length;i++)  
           {  
                       if  (dt.Rows[i].IsChild  ==  1)  //叶子节点  
                       {  
                                   var  li  =  document.createElement("li");  
                                   li.className  =  "Child";  
                                   li.id  =  "li_"  +  dt.Rows[i].CategoryID;  
                                     
                                   var  img  =  document.createElement("img");  
                                   img.id  =  dt.Rows[i].CategoryID;  
                                   img.className  =  "s";  
                                   img.src  =  "css/s.gif";  
                                     
                                   var  a  =  document.createElement("a");  
                                   a.href  =  "javascript:OpenDocument('"  +  dt.Rows[i].CategoryID  +  "');";  
                                   a.innerHTML  =  dt.Rows[i].CategoryName;  
                       }  
                       else  
                       {  
                                   var  li  =  document.createElement("li");  
                                   li.className  =  "Closed";  
                                   li.id  =  "li_"  +  dt.Rows[i].CategoryID;  
                                     
                                   var  img  =  document.createElement("img");  
                                   img.id  =  dt.Rows[i].CategoryID;  
                                   img.className  =  "s";  
                                   img.src  =  "css/s.gif";  
                                   img.onclick  =  function  ()  {  
                                               ExpandSubCategory(this.id);  
                                   };  
                                   img.alt  =  "展开/折叠";  
                                     
                                   var  a  =  document.createElement("a");  
                                   a.href  =  "javascript:ExpandSubCategory("  +  
                                               dt.Rows[i].CategoryID  +  ");";  
                                   a.innerHTML  =  dt.Rows[i].CategoryName;  
                       }  
                       li.appendChild(img);  
                       li.appendChild(a);  
                       ul.appendChild(li);              
           }  
           li_father.appendChild(ul);  
             
           displayDocList(iCategoryID);  
           switchNote(iCategoryID,  false);  
 
}  
 
后台代码:  
[AjaxMethod()]  
public  DataSet  GetSubCategory(int  iCategoryID)  
{  
           DataSet  ds  =  new  DataSet();  
 
           SqlConnection  conn  =  
                       new  SqlConnection(ConfigurationSettings.AppSettings["ConnStr"]);  
           SqlCommand  cmd  =  conn.CreateCommand();                                      
           cmd.CommandText  =  string.Format(  
               "SELECT  CategoryID,  CategoryName,  FatherID,  dbo.IsLeaf(CategoryID)  as  IsChild  FROM  Category  WHERE  FatherID  =  {0}",  
                       iCategoryID);  
           SqlDataAdapter  da  =  new  SqlDataAdapter(cmd);  
 
           try  
           {  
                       da.Fill(ds);  
           }  
           catch  (SqlException)  
           {  
           }  
           finally  
           {  
                       conn.Close();  
           }  
 
           System.Threading.Thread.Sleep(500  +  rand.Next(1000));  
 
           return  ds;  
}

解决方案 »

  1.   

    看看你的webcofig配置和页面初始化方法配置
      

  2.   

    asp.net 2.0 用ajaxpro.2.dll
      

  3.   

    注释掉 System.Threading.Thread.Sleep(500  +  rand.Next(1000));  看看...另外是不会进入断点的,实际上相当于输出为js了,断点和调试都不会起作用,对于后台方法来说...
      

  4.   

    你要先看看你引用的dll是不是asp.net2.0的!
      

  5.   

    http://www.cnblogs.com/ustbwuyi这里有我两篇关于ajax的文章,楼主可以看看