ScriptManager之PageMethods
 
在VB的寫法 <System.Web.Services.WebMethod( )> _
<System.Web.Script.Services.ScriptMethod( )> _
Public Shared Function ListUserCates(ByVal PK_MID As String) As String( )

        '***傳回dataTable時會產生JavaScript型別不能辨認的問題 , 這是個有待解決的問題

    Return String( )

End Function
在JavaScript呼叫 function changeCate(Cate){
     PageMethods.CreateCate(Cate, changeIDs);
}

Cate是參數
changeIDs是另一個 接值的 function
如果在後面再加一個function 時表示發生錯誤時觸發的function
javaScript裡接值 function changeIDs( dt ){

    dt 是指在Ajax裡傳回來的string( ) 參數

 }
ScriptManager元件的修改 如果要用PageMethods的話 , 記得要將 EnablePageMethods 設為true