没看明白你的问题,呵呵,是完全手写的ajax,还是用的哪个ajax框架(比如ajax.net)?页面a上的按钮在异步刷新控件里面还是在外面?当前页面(A)刷新的时候提示服务器找不到----是提示找不到服务器?还是提示服务器找不到页面B?或者是找不到页面A?呵呵,问题表达清楚啦,也许能更好的解决问题

解决方案 »

  1.   

    这个应该不是ajax的问题
    搂主,能把具体的错误贴出来吗?然后能说说你页面实现的功能
      

  2.   

    我用AjaxPro。
    点击A上button打开子窗口B,A自己并没有关闭。A在刷新的时候先出现一个警告,"Internet Explore cannot open the internnet site http://localhost/ECappsWeb/Customer/QuotationDetails.aspx, operation aborted".点击这个alter的确认,页面显示"Cannot find server"
      

  3.   

    a页面上用ajax,a页面刷新的是a页面的局部,那你为什么要打开b页面并关闭a页面?
      

  4.   

    代码如下:
    我是参照下面的网址
    http://www.cnblogs.com/mvp33650/archive/2007/04/27/730319.html 
    我没有关闭A,A是主窗口,B时详细资料,是一个弹出窗口,因为点击按钮时候有postback,页面自动刷新。
    ------------------------------- 
    CS file
    --------------------------------
    protected void Page_Load(object sender, EventArgs e)
        {        
               if (hidCustCode.Value != "N")
                    AjaxPro.Utility.RegisterTypeForAjax(typeof(Customer_QuotationDetails));
            if (!Page.IsPostBack)
            {
                InitializePage();
                AddAtribute();
                if (PageMode != (int)AAEnumeration.PageMode.NULL)
                {                
                        BindData();
                  }
                }
            }
        }
        private void AddAtribute()
        {
            txtCUST_CODE.Attributes.Add("onfocus", "setControlOnFoucs()");
            txtCUST_CODE.Attributes.Add("onblur", "setControlLostFoucs()");
            btnAddItem.Attributes.Add("onClick", "setControlLostFoucs()");
            btnSaveItem.Attributes.Add("onClick", "setControlLostFoucs()");
            btnRetrieve.Attributes.Add("onClick", "setControlLostFoucs()");
         }    [AjaxMethod()]
        public ArrayList GetCustomerCode(string strQuery)
        {
            //ArrayList items = AAPool.GetCustomerCode();
           //For Testing
            ArrayList items = new ArrayList();
            for (int i = 0; i < 10; i++)
            {
                items.Add("A" + i.ToString());
                items.Add("B" + i.ToString());
            }
            ArrayList selectItems = new ArrayList();
            foreach (string str in items)
            {
                if (str.ToUpper().IndexOf(strQuery.ToUpper()) == 0)
                {
                    selectItems.Add(str);
                }
            }
            return selectItems;
        }
     protected void btnRetrieve_Click(object sender, EventArgs e)
        {
            Hashtable htable = new Hashtable();
            htable.Add(AAConstant.PageMode, (int)AAEnumeration.PageMode.ADD);
            ClientScript.RegisterStartupScript(this.GetType(), otherQuotation, GetSecondDetailsURL(htable, 
    Constant.RetrieveFromOtherQuotationUI, otherQuotation));
        }--------------------------------
    aspx file
    --------------------------------
    <script language="jscript">
            mainLoop = function()
            {
                val = escape( queryField.value );
                if( lastVal != val && document.getElementById('hidCustCode').value == 'Y' )
                {
                    //alert("div " + document.getElementById('hidCustCode').value);
                    var response = Customer_QuotationDetails.GetCustomerCode( val );
                    showQueryDiv( response.value );
                    lastVal = val;
                }
                setTimeout('mainLoop()', 100);
                return true;
            } 
            
            function setControlOnFoucs()
            {            
                document.getElementById('hidCustCode').value = 'Y';
            }
             function setControlLostFoucs()
            {
                document.getElementById(ctrlID).value = 'N';
            }
        </script>    
        <asp:TextBox ID="txtCUST_CODE" runat="server" Width="90%"> </asp:TextBox>
        <script language="jscript">InitQueryCode("" + '<%= txtCUST_CODE.ClientID %>' + "");</script>
    ----------------------------------------------------------------------------
      

  5.   

    ajaxpro不会用asp.net ajax我到可以看看。