.net2003 使用 Ajax.dll 小结

来源:互联网 发布:耐驰差热分析软件 编辑:程序博客网 时间:2024/05/20 23:34
重要补充:
重要补充:
Ajax.dll 和 AjaxPro.dll 是两家不同的产品, 但用法很类似, 对于.net 1.1 和.net 2.0
需要不同的dll支持!!
Ajax.dll 官网: http://ajax.schwarz-interactive.de/csharpsample/default.aspx
AjaxPro.dll 官网: http://www.ajaxpro.info/
两者使用比较: ajax两组件之对比(ajax.dll,ajaxpro.dll) http://blog.csdn.net/nicewon/archive/2007/04/06/1554460.aspx
 
最近由于任务需要不得不重新接触.net2003 但是要使用到javascript,而又感觉.net代码很乱,不好跟JS交互,所以使用了Ajax.dll来帮助简化,以下是简单的总结,希望对大家有用!
简单流程:

view plaincopy to clipboardprint?
  1. 测试环境:   
  2. XP + .Net 2003 + Ajax.dll 5.7.22.2   
  3.   
  4.   
  5. 1> .net项目添加引用 Ajax.dll   
  6. 2> 在 web.config 文件里按如下格式添加配置:   
  7. (说明:这里是指定一个虚拟路径以动态给出js文件下载地址)   
  8. <configuration>   
  9.   <system.web>   
  10.     <httpHandlers>   
  11.     <add verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax" />   
  12.     </httpHandlers>     
  13.     ...   
  14.   <system.web>   
  15. </configuration>   
  16.   
  17. 3> 在一个类(任意类)里实现一个Ajax方法:   
  18. using System;   
  19.   
  20. namespace zhAjax{   
  21.   public class AjaxTest{   
  22.     public AjaxTest(){}   
  23.     [Ajax.AjaxMethod]//Ajax方法   
  24.     public int sum(int a, int b){   
  25.       return a+b;   
  26.     }   
  27.   }   
  28. }   
  29.   
  30. 4> 在一个aspx页面的codebehind代码中的Page_Load()方法中加入如下代码:   
  31. private void Page_Load(object sender, System.EventArgs e){   
  32.     //在当前页面中注册服务器端的Ajax方法,注册的类是zhAjax.AjaxTest   
  33.     //其中zhAjax是命名空间,AjaxTest是类名。   
  34.   Ajax.Utility.RegisterTypeForAjax(typeof(zhAjax.AjaxTest));   
  35. }   
  36.   
  37. 5> 在aspx页面里包含自己用到的JS文件,两个内容如下:   
  38. aspx文件:    
  39. <%@ Page language="c#" Codebehind="Z.aspx.cs" AutoEventWireup="false" Inherits="zhAjax.WebForm2" %>   
  40. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >   
  41. <HTML> <HEAD>   
  42.   <title>WebForm2</title>   
  43.   <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">   
  44.   <meta name="CODE_LANGUAGE" Content="C#">   
  45.   <meta name="vs_defaultClientScript" content="JavaScript">   
  46.   <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">   
  47.   <script type=text/javascript language=javascript src='js.js' ></script>   
  48.   <!-- 注意:自己引入的JS标签一定要有单独的结尾标签</script>,否则将会出现   
  49. ajax_request为定义的现象,应为IE6将其其后的html都当作javascript了,    
  50. 同时要注意自己的Javascript不要出现任何错误 -->   
  51. </HEAD>   
  52.  <body MS_POSITIONING="GridLayout">   
  53.   <form id="Form1" method="post" runat="server">   
  54.    A: <input id=a size=15 ><br >   
  55.    B: <input id=b size=15 ><br >   
  56.    SUM: <input id=sum size=15 ><br >   
  57.    <input type=button value='计算' onclick="myFunc()" ><br >   
  58.   </form>   
  59.  </body>   
  60.   
  61. </HTML>   
  62. js文件:js.js   
  63. function myFunc(){   
  64.  AjaxTest.sum(   
  65.   document.getElementById("a").value,   
  66.   document.getElementById("b").value,   
  67.   callback   
  68.  );   
  69. }   
  70. function callback(ret){   
  71.  document.getElementById("sum").value = ret.value;   
  72. }   
为了方便学习,顺便把官网给的例子中的关键源程序贴出来以方便学习:
Methods.CS
view plaincopy to clipboardprint?
  1. using System;   
  2. using System.Web;   
  3. namespace CSharpSample   
  4. {   
  5.  /// <summary>   
  6.  /// Summary description for Methods.   
  7.  /// </summary>   
  8.  public class DemoMethods   
  9.  {   
  10.   [Ajax.AjaxMethod]   
  11.   public static string Test1(string firstName, string familyName, string email, string comment)   
  12.   {   
  13.    return "Hello " + firstName + " " + familyName + "<br>Thank you for your comment ("    
  14. + DateTime.Now.ToString() + "):<br><b>" + System.Web.HttpUtility.HtmlEncode(comment).Replace("/r""<br>") + "</b>.";   
  15.   }   
  16.   [Ajax.AjaxMethod]   
  17.   public string Test2(DateTime d)   
  18.   {   
  19.    d = d.AddDays(1);   
  20.    return "The next day will be " + d.ToLongDateString() + ".";   
  21.   }   
  22.   [Ajax.AjaxMethod]   
  23.   public System.Data.DataSet Test3()   
  24.   {   
  25.    System.Data.DataSet ds = new System.Data.DataSet();   
  26.    System.Data.DataTable dt = new System.Data.DataTable();   
  27.    dt.Columns.Add("Country"typeof(System.String));   
  28.    ds.Tables.Add(dt);   
  29.    System.Data.DataRow row;   
  30.       
  31.    // fill sample data (i.e. can be replaced with database query)   
  32.       
  33.    row = ds.Tables[0].NewRow();   
  34.    row["Country"] = "Germany";   
  35.    dt.Rows.Add(row);   
  36.    row = ds.Tables[0].NewRow();   
  37.    row["Country"] = "Austria";   
  38.    dt.Rows.Add(row);   
  39.    row = ds.Tables[0].NewRow();   
  40.    row["Country"] = "Switzerland";   
  41.    dt.Rows.Add(row);   
  42.    row = ds.Tables[0].NewRow();   
  43.    row["Country"] = "France";   
  44.    dt.Rows.Add(row);   
  45.    row = ds.Tables[0].NewRow();   
  46.    row["Country"] = "Bavaria  ;)";   
  47.    dt.Rows.Add(row);   
  48.   
  49.    return ds;   
  50.   }   
  51.   [Ajax.AjaxMethod]   
  52.   public void Test4()   
  53.   {   
  54.    throw new System.Security.SecurityException("This user does not have access rights on this resource.");   
  55.   }   
  56.   [Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)]   
  57.   public void Test5(string value)   
  58.   {   
  59.    HttpContext.Current.Session["test"] = value;   
  60.   }   
  61.   [Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.Read)]   
  62.   public string Test6()   
  63.   {   
  64.    if(HttpContext.Current.Session["test"] != null)   
  65.     return (string)HttpContext.Current.Session["test"];   
  66.    return "First set the value...";   
  67.   }   
  68.      
  69.   [Ajax.AjaxMethod]   
  70.   public void Test7()   
  71.   {   
  72.    int c = 0;   
  73.       
  74.    do  
  75.    {   
  76.     System.Threading.Thread.Sleep(1000);   
  77.     c++;   
  78.    }   
  79.    while(c < 10);   
  80.   }   
  81.   
  82.   [Ajax.AjaxMethod]   
  83.   public int Test8()   
  84.   {   
  85.    Random r = new Random(System.DateTime.Now.Second);   
  86.    return r.Next(0, 100);   
  87.   }   
  88.   
  89.   [Ajax.AjaxMethod]   
  90.   public System.Collections.Specialized.StringCollection Test9()   
  91.   {   
  92.    System.Collections.Specialized.StringCollection s = new System.Collections.Specialized.StringCollection();   
  93.    s.Add("Michael");   
  94.    s.Add("Hans");   
  95.    return s;   
  96.   }   
  97.   [Ajax.AjaxMethod]   
  98.   public object[] Test10()   
  99.   {   
  100.    object[] o = new object[3];   
  101.    o[0] = "Michael";   
  102.    o[1] = DateTime.Now;   
  103.    o[2] = true;   
  104.    return o;   
  105.   }   
  106.   [Ajax.AjaxMethod]   
  107.   public System.Collections.ArrayList Test11()   
  108.   {   
  109.    System.Collections.ArrayList a = new System.Collections.ArrayList();   
  110.    a.Add("Michael");   
  111.    a.Add(DateTime.Now);   
  112.    a.Add(true);   
  113.    Person p1 = new Person();   
  114.    p1.FirstName = "Michael";   
  115.       
  116.    SpecialPerson p2 = new SpecialPerson();  // will be inherit from Person   
  117.    p2.FirstName = "Tanja";   
  118.    p2.Comment = "My comment for this person!";   
  119.    a.Add(p1);   
  120.    a.Add(p2);   
  121.    return a;   
  122.   }   
  123.   [Ajax.AjaxMethod]   
  124.   public Person Test12()   
  125.   {   
  126.    // Create your own class like you have done it before.   
  127.    // See Person class at end of this file!   
  128.    Person p = new Person();   
  129.    p.FirstName = "Michael";   
  130.    p.FamilyName = "Schwarz";   
  131.    p.Age = 28;   
  132.    Person mj = p.NewChild();   
  133.    mj.FirstName = "Marc Julain";   
  134.    mj.Age = 3;   
  135.    Person jo = p.NewChild();   
  136.    jo.FirstName = "Jan Oliver";   
  137.    jo.Age = 1;   
  138.    p.Children = new Person[2];   
  139.    p.Children[0] = mj;   
  140.    p.Children[1] = jo;   
  141.    // Return the object without any change on the source code.   
  142.    return p;   
  143.   }   
  144.   [Ajax.AjaxMethod]   
  145.   public NewsTicker Test13()   
  146.   {   
  147.    NewsTicker[] nt = new NewsTicker[10];  
  148.    #region Build some examples (will be stored in a database or xml file)   
  149.    nt[0] = new NewsTicker("Ajax.NET Library""http://ajax.schwarz-interactive.de", 4);   
  150.    nt[1] = new NewsTicker("Google Search""http://www.google.com", 2);   
  151.    nt[2] = new NewsTicker("It is now " + DateTime.Now.ToString(), "http://ajax.schwarz-interactive.de", 4);   
  152.    nt[3] = new NewsTicker("ASP.NET Weblogs""http://weblogs.asp.net/mschwarz", 3);   
  153.    nt[4] = new NewsTicker("Free Ajax.NET Wrapper""http://weblogs.asp.net/mschwarz", 4);   
  154.    nt[5] = new NewsTicker("New C# examples online!""http://ajax.schwarz-interactive.de", 3);   
  155.    nt[6] = new NewsTicker("PC-Topp.NET Demo""http://demo.pctopp.com", 2);   
  156.    nt[7] = new NewsTicker("NEW Ajax.NET Library""http://ajax.schwarz-interactive.de", 4);   
  157.    nt[8] = new NewsTicker("Download ajax.dll""http://ajax.schwarz-interactive.de", 2);   
  158.    nt[9] = new NewsTicker("Free Download!!""http://ajax.schwarz-interactive.de", 2);  
  159.    #endregion   
  160.    Random r = new Random(System.DateTime.Now.Second);   
  161.    int i = r.Next(0, nt.Length -1);   
  162.    return nt[i];   
  163.   }   
  164.   [Ajax.AjaxMethod]   
  165.   public System.Data.DataSet Test15()   
  166.   {   
  167.    System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection("server=(local);uid=??;password=????;Initial Catalog=Northwind;");   
  168.    System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand("SELECT TOP 10 * FROM Customers C INNER JOIN Orders O ON O.CustomerID = C.CustomerID", conn);   
  169.       
  170.    System.Data.SqlClient.SqlDataAdapter da = new System.Data.SqlClient.SqlDataAdapter(cmd);   
  171.    System.Data.DataSet ds = new System.Data.DataSet();   
  172.    try  
  173.    {   
  174.     conn.Open();   
  175.     try  
  176.     {   
  177.      da.Fill(ds);   
  178.     }   
  179.     catch(Exception)   
  180.     {}   
  181.     finally  
  182.     {   
  183.      conn.Close();   
  184.      conn.Dispose();   
  185.     }   
  186.    }   
  187.    catch(Exception)   
  188.    {}   
  189.    return ds;   
  190.   }   
  191.   [Ajax.AjaxMethod]   
  192.   public System.Drawing.Bitmap Test16()   
  193.   {   
  194.    System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(200, 50);   
  195.    System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bmp);   
  196.      
  197.    g.FillRectangle(new System.Drawing.SolidBrush(System.Drawing.Color.Yellow), 0, 0, 199, 49);   
  198.    g.DrawString(DateTime.Now.ToString(), new System.Drawing.Font("Arial", 10), new System.Drawing.SolidBrush(System.Drawing.Color.Red), 10, 10);   
  199.    return bmp;   
  200.   }   
  201.   [Ajax.AjaxMethod]   
  202.   public int Test17(int[] i)   
  203.   {   
  204.    int r = 0;   
  205.    foreach(int ii in i)   
  206.     r += ii;   
  207.    return r;   
  208.   }   
  209.   [Ajax.AjaxMethod]   
  210.   public string Test18(string[] s)   
  211.   {   
  212.    string r = "";   
  213.    foreach(string ss in s)   
  214.     r += "<p>" + ss + "</p>/r/n";   
  215.    return r;   
  216.   }   
  217.   [Ajax.AjaxMethod]   
  218.   public System.Web.UI.HtmlControls.HtmlSelect Test19(string car)   
  219.   {   
  220.    System.Web.UI.HtmlControls.HtmlSelect control = new System.Web.UI.HtmlControls.HtmlSelect();   
  221.    switch(car)   
  222.    {   
  223.     case "VW":   
  224.      control.Items.Add("Golf");   
  225.      control.Items.Add("Passat");   
  226.      control.Items.Add("Beetle");   
  227.      control.Items.Add("Phaeton");   
  228.      break;   
  229.     case "Mercedes":   
  230.      control.Items.Add("S Class");   
  231.      control.Items.Add("E Class");   
  232.      control.Items.Add("A Class");   
  233.      control.Items.Add("M Class");   
  234.      break;   
  235.     case "Citroen":   
  236.      control.Items.Add("C3 Pluriel");   
  237.      control.Items.Add("C5 Break");   
  238.      control.Items.Add("C8");   
  239.      control.Items.Add("Berlingo");   
  240.      break;   
  241.    }   
  242.    return control;   
  243.   }   
  244.   [Ajax.AjaxMethod(30)]   
  245.   public System.DateTime Test20()   
  246.   {   
  247.    return DateTime.Now;   
  248.   }   
  249.   [Ajax.AjaxMethod]   
  250.   public System.Web.UI.HtmlControls.HtmlSelect Test21(System.Web.UI.HtmlControls.HtmlSelect select)   
  251.   {   
  252.    select.Items.Add("New option added at " + DateTime.Now);   
  253.    return select;   
  254.   }   
  255.   [Ajax.AjaxMethod]   
  256.   public System.Xml.XmlDocument Test22()   
  257.   {   
  258.    System.Xml.XmlDocument doc = new System.Xml.XmlDocument();   
  259.    doc.LoadXml("<ROOT/>");   
  260.    doc.DocumentElement.InnerText = DateTime.Now.ToString();   
  261.    return doc;   
  262.   }   
  263.  }   
  264.   
  265.   
  266.   
  267.  [Serializable]   
  268.  public class NewsTicker   
  269.  {   
  270.   public Guid ID = Guid.NewGuid();   
  271.   public NewsTicker(string text, string url, int duration)   
  272.   {   
  273.    this.Text = text;   
  274.    this.URL = url;   
  275.    this.Duration = duration;   
  276.   }   
  277.   public string Text;   
  278.   public string URL;   
  279.   public int Duration = 60;   
  280.  }   
  281.  [Serializable]   
  282.  public class Person // : System.Collections.CollectionBase   
  283.  {   
  284.   public string FirstName;   
  285.   public string FamilyName;   
  286.   public int Age = 0;   
  287.   public decimal Money = 200.5m;    
  288.   public Person NewChild()   
  289.   {   
  290.    Person p = new Person();   
  291.    p.FamilyName = FamilyName;   
  292.    return p;   
  293.   }   
  294.   public Person[] Children = null;  
  295.   #region CollectionBase Methods   
  296. //  public Person this[ int index ]     
  297. //  {   
  298. //   get{ return ((Person)List[index]); }   
  299. //   set{ List[index] = value; }   
  300. //  }   
  301. //   
  302. //  public int Add(Person value)   
  303. //  {   
  304. //   return(List.Add(value));   
  305. //  }   
  306. //   
  307. //  public int IndexOf(Person value)     
  308. //  {   
  309. //   return(List.IndexOf(value));   
  310. //  }   
  311. //   
  312. //  public void Insert(int index, Person value)     
  313. //  {   
  314. //   List.Insert(index, value);   
  315. //  }   
  316. //   
  317. //  public void Remove(Person value)     
  318. //  {   
  319. //   List.Remove(value);   
  320. //  }   
  321. //   
  322. //  public bool Contains(Person value)     
  323. //  {   
  324. //   // If value is not of type Int16, this will return false.   
  325. //   return(List.Contains(value));   
  326. //  }   
  327. //   
  328. //  protected override void OnInsert(int index, Object value)     
  329. //  {   
  330. //   if(value.GetType() != Type.GetType("CSharpSample.Person"))   
  331. //    throw new ArgumentException("value must be of type CSharpSample.Person.", "value");   
  332. //  }   
  333. //   
  334. //  protected override void OnRemove(int index, Object value)     
  335. //  {   
  336. //   if(value.GetType() != Type.GetType("CSharpSample.Person"))   
  337. //    throw new ArgumentException("value must be of type CSharpSample.Person.", "value");   
  338. //  }   
  339. //   
  340. //  protected override void OnSet(int index, Object oldValue, Object newValue)     
  341. //  {   
  342. //   if(newValue.GetType() != Type.GetType("CSharpSample.Person"))   
  343. //    throw new ArgumentException("newValue must be of type CSharpSample.Person.", "newValue");   
  344. //  }   
  345. //   
  346. //  protected override void OnValidate(Object value)     
  347. //  {   
  348. //   if(value.GetType() != Type.GetType("CSharpSample.Person"))   
  349. //    throw new ArgumentException("value must be of type CSharpSample.Person.");   
  350. //  }  
  351.   #endregion   
  352.  }   
  353.  [Serializable]   
  354.  public class SpecialPerson : Person   
  355.  {   
  356.   public string Comment = "";   
  357.  }   
  358.  [Serializable]   
  359.  public class IAjaxObjectSource   
  360.  {   
  361.   public string Title = "";   
  362.   public string Filename = "";   
  363.   public IAjaxObjectSource(string title, string filename)   
  364.   {   
  365.    Title = title;   
  366.    Filename = filename;   
  367.   }   
  368.  }   
  369. }   
default.js
view plaincopy to clipboardprint?
  1. function callback_test1(res)   
  2. {   
  3.  document.getElementById("display1").innerHTML = res.value;   
  4. }   
  5. function test1()   
  6. {   
  7.  DemoMethods.Test1(   
  8.   document.getElementById("firstName").value,    
  9.   document.getElementById("familyName").value,   
  10.   document.getElementById("email").value,   
  11.   document.getElementById("comment").value,   
  12.   callback_test1   
  13.   );   
  14. }   
  15. function callback_test2(res)   
  16. {   
  17.  document.getElementById("display2").innerHTML = res.value;   
  18. }   
  19. function test2()   
  20. {   
  21.  var d = null;   
  22.  try    
  23.  {   
  24.   d = new DateTime(   
  25.    document.getElementById("year").value,   
  26.    document.getElementById("month").value,   
  27.    document.getElementById("day").value,   
  28.    0, 0, 0   
  29.    );   
  30.      
  31.   DemoMethods.Test2(d, callback_test2);   
  32.  }   
  33.  catch(e)   
  34.  {   
  35.   alert("Error: " + e.description);   
  36.  }   
  37. }   
  38. function callback_test3(res)   
  39. {   
  40.  if(res != null && res.value != null && res.value.Tables != 0 && res.value.Tables.length == 1)   
  41.  {   
  42.   var html = [];   
  43.      
  44.   for(var i=0; i<res.value.Tables[0].Rows.length; i++)   
  45.    html[html.length] = "<option>" + res.value.Tables[0].Rows[i].Country + "</option>";   
  46.     
  47.   document.getElementById("display3").innerHTML = "<select>" + html.join("") + "</select>";   
  48.  }   
  49. }   
  50. function test3()   
  51. {   
  52.  DemoMethods.Test3(callback_test3);   
  53. }   
  54. function test4()   
  55. {   
  56.  var res = DemoMethods.Test4();   
  57.  if(res.error != null) alert(res.error);   
  58. }   
  59. function test5()   
  60. {   
  61.  DemoMethods.Test5(document.getElementById("sessionTest1").value);   
  62. }   
  63. function callback_test6(res)   
  64. {   
  65.  document.getElementById("sessionTest2").value = res.value;   
  66. }   
  67. function test6()   
  68. {   
  69.  DemoMethods.Test6(callback_test6);   
  70. }   
  71. function callback_test7(res)   
  72. {   
  73.  alert("The server has finished the 10 seconds call, now!");   
  74. }   
  75. function test7()   
  76. {   
  77.  DemoMethods.Test7(callback_test7);   
  78. }   
  79. function test8(ele)   
  80. {   
  81.  DemoMethods.Test8(test8_callback, ele);  // the server-side method has no arguments!   
  82. }   
  83. function test8_callback(res)   
  84. {   
  85.  if(res.error == null && res.context != null)   
  86.   res.context.innerHTML = res.value;   
  87. }   
  88. function test11()   
  89. {   
  90.  DemoMethods.Test11(test11_callback);   
  91. }   
  92. function test11_callback(res)   
  93. {   
  94.  if(res.value[2])       // bolean   
  95.   alert(res.value[1].toLocaleString()); // date   
  96.      
  97.  alert(res.value[3].FirstName + " + " + res.value[4].FirstName);   
  98. }   
  99. function test12()   
  100. {   
  101.  DemoMethods.Test12(test12_callback);   
  102. }   
  103. function test12_callback(res)   
  104. {   
  105.  var s = res.value.FirstName + " " + res.value.FamilyName + ":/r/n";   
  106.     
  107.  for(var i=0; i<res.value.Children.length; i++)   
  108.   s += "/t" + res.value.Children[i].FirstName + "/r/n";   
  109.     
  110.  alert(s);   
  111. }   
  112. function test13()   
  113. {   
  114.  // call the Ajax.NET method on the server to get   
  115.  // a new news ticker object   
  116.      
  117.  DemoMethods.Test13(test13_callback);   
  118. }   
  119. function test13_callback(res)   
  120. {   
  121.  if(typeof(res.value) == 'object')   
  122.  {   
  123.   // display the news ticker   
  124.        
  125.   document.getElementById('newsticker').innerHTML = '<a href="' + res.value.URL + '">' + res.value.Text + '</a>';   
  126.   window.setTimeout(test13, res.value.Duration * 1000);   
  127.  }   
  128. }   
  129. function test16()   
  130. {   
  131.  DemoMethods.Test16(test16_callback);   
  132. }   
  133. function test16_callback(res)   
  134. {   
  135.  if(typeof(res.value) == 'object')   
  136.  {   
  137.   document.getElementById("imageholder").innerHTML = '';   
  138.   document.getElementById("imageholder").appendChild(res.value);   
  139.  }   
  140. }   
  141. function test17(n)   
  142. {   
  143.     // n will be a array of numbers/integer   
  144.  if(typeof(n) != 'object'return;   
  145.  alert(DemoMethods.Test17(n).value);   
  146. }   
  147. function test18()   
  148. {   
  149.  alert(DemoMethods.Test18( ["aaaa","bbbb","ccc/"ccccc"] ).value);   
  150. }   
  151. function test19(ele, car)   
  152. {   
  153.  HtmlControlUpdate('DemoMethods.Test19''dropDisplay', car);   
  154. }   
  155. function test20()   
  156. {   
  157.  return DemoMethods.Test20().value;   
  158. }   
  159. function test21(controlHolderId, id)   
  160. {   
  161.  HtmlControlUpdate('DemoMethods.Test21', controlHolderId, new HtmlControl(id));   
  162. }   
  163. window.attachEvent("onload", test13);   
  164.   
 
原创粉丝点击