使用微软那个ajax组件,如何在page_load的时候就能发出ajax请求,使得页面异步加载?谢谢解答

解决方案 »

  1.   

    public void Page_Load(Object sender, EventArgs e)
      {
        // Define the name and type of the client scripts on the page.
        String csname1 = "PopupScript";
        Type cstype = this.GetType();    // Get a ClientScriptManager reference from the Page class.
        ClientScriptManager cs = Page.ClientScript;    // Check to see if the startup script is already registered.
        if (!cs.IsStartupScriptRegistered(cstype, csname1))
        {
            StringBuilder cstext1 = new StringBuilder();
            cstext1.Append("<script type=text/javascript>doAjax()</");
            cstext1.Append("script>");        cs.RegisterStartupScript(cstype, csname1, cstext1.ToString());
        }
      

  2.   

    $.ajax({
    type:"GET",
    url:"="+new Date(),        
    data:"",
    success:function(text){
                 $("#str").text(text);
            }
     });
    $(document).ready(function()     
      

  3.   

    可能我没说明白,我是想让updatepanel能够起作用,在page_load的时候 期待高手的解答,谢谢了