点第一个dropdownlist1时,绑定数据到dropdownlist2,
我想点第二个dropdownlist2时跳转页面,但出问题了。Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.Details: Error parsing near '<!DOCTYPE html P'.
高手,解答下,这是什么意思,如何解决非常感谢。

解决方案 »

  1.   

    把你的HTML 贴出来 应该是多了个'这个符号
      

  2.   

    好,我把代码全贴出来。这是我自定义控件<%@ Control Language="C#" AutoEventWireup="true" CodeFile="cm_new_all_search.ascx.cs" Inherits="cmscontrol_cm_new_all_search" %>
    <%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        Namespace="System.Web.UI" TagPrefix="asp" %>
    <%@ Register tagprefix="cm" tagname="rteditor" src="cm_rteditor.ascx" %>
    <%@ Register TagPrefix="cm" TagName="new_cuisine" Src="cm_new_cuisine.ascx" %>
    <%@ Import Namespace="Sproutapps.CMSEntity" %>
    <script language="C#" runat="server">
        String Country;
        String City;
        String pagesid;
        CMCity oCity;
        
        private void Page_Load(Object source, EventArgs e)
        {
            City = Request.QueryString["City"] == null ? "" : Request.QueryString["City"];
            Country = Request.QueryString["Country"] == null ? "" : Request.QueryString["Country"];
            
            pagesid = Request.QueryString["pagesid"];
            CMPage oPage_city = new CMPage(pagesid);
            oCity = new CMCity(oPage_city.City);
            City = oCity.Sid;
            Country = oCity.Country;
            
            if (!this.IsPostBack)
            {
                   
                //CMSettingctyCollection clSettingcty = new CMSettingctyCollection();
                //clSettingcty.ListAll();
                //uiCountry.DataSource = clSettingcty.List;
                Ajax.Utility.RegisterTypeForAjax(typeof(AjaxMethod));
                uiCountry.DataSource = AjaxMethod.GetCountry();
                uiCountry.DataBind();
                uiCountry.Items.Insert(0, new ListItem("-- country --", ""));
                uiCity.Items.Insert(0, new ListItem("-- city --", ""));
                uiHotel.Items.Insert(0, new ListItem("-- hotel --", ""));         //   this.uiCountry.Attributes.Add("onclick", "cityResult();");
              //  this.uiCity.Attributes.Add("onclick", "areaResult();");
                this.uiCity.Attributes.Add("onclick", "cityResult();");
                
                if (!String.IsNullOrEmpty(Country))
                {
                    CMCityCollection clCity = new CMCityCollection();
                    clCity.ListByCountry(Country);
                    uiCity.DataSource = clCity.List;
                    uiCity.DataBind();
                    uiCity.Items.Insert(0, new ListItem("-- city --", ""));
                    uiCity.SelectedValue = City;
                    uiCountry.SelectedValue = Country;
                }            if (!String.IsNullOrEmpty(City))
                {
                    CMHotelCollection clHotel = new CMHotelCollection();
                    clHotel.ListByCity(City);
                    uiHotel.DataSource = clHotel.List;
                    uiHotel.DataBind();
                    uiHotel.Items.Insert(0, new ListItem("-- hotel --", ""));
                }
            }
        }
        public void uiCountry_SelectedIndexChanged(Object sender, EventArgs e)
        {        CMCityCollection clCity = new CMCityCollection();
            clCity.ListByCountry(uiCountry.SelectedValue);
            uiCity.DataSource = clCity.List;
            uiCity.DataBind();
            uiCity.Items.Insert(0, new ListItem("-- City --", ""));
        }
        public void uiCity_SelectedIndexChanged(Object sender, EventArgs e)
        {
            CMCity oCity = new CMCity(uiCity.SelectedValue);
            CMPage oPage = oCity.RetrieveProfilepage();
            //Response.Redirect(oPage.GetFullUrl() + "?Country=" + uiCountry.SelectedValue + "&City=" + uiCity.SelectedValue);
            Response.Redirect(oPage.GetFullUrl());    
        }
        public void uiHotel_SelectedIndexChanged(Object sender, EventArgs e)
        {
            CMHotel oHotel = new CMHotel(uiHotel.SelectedValue);
            CMPage oPage = oHotel.RetrieveProfilepage();
            //Response.Redirect(oPage.GetFullUrl() + "?tab=edm");
            Response.Redirect(oPage.GetFullUrl());
        }
        public void btnSubmit_Click(Object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(this.keyword.Text))
            {
                Response.Redirect("search.aspx?q=" + this.keyword.Text + "&ie=utf-8");
            }
        }
    </script>
    <%--<script language="javascript" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> 
    <script language="javascript" type="text/javascript"> 
    $(function() { 
    var $ddl = $("select[name$=uiCountry]"); 
    var $ddlCars = $("select[name$=uiCity]"); 
    $ddl.focus(); 
    $ddl.bind("change keyup", function() { 
    if ($(this).val() != "0") { 
    loadEmployeeCars($("select option:selected").val()); 
    $ddlCars.fadeIn("slow"); 
    } else { 
    $ddlCars.fadeOut("slow"); 

    }); 
    }); function loadEmployeeCars(selectedItem) { 
    $.ajax({ 
    type: "POST", 
    url: "index.aspx", 
    data: "{id: " + selectedItem + "}", 
    contentType: "application/json; charset=utf-8", 
    dataType: "json", 
    async: true, 
    success: function Success(data) { 
    printEmployeeCars(data.d); 

    }); 
    } function printEmployeeCars(data) { 
    $("select[name$=uiCity] > option").remove(); 
    for (var i = 0; i < data.length; i++) { 
    $("select[name$=uiCity]").append( 
    $("<option></option>").val(data[i].Id).html(data[i].Car) 
    ); 


    </script> --%>
    <%--<SCRIPT language="javascript"> function cityResult() 

    var city=document.getElementById("new_all_search_uiCountry");
    AjaxMethod.GetCityList(city.value);
    }

    function get_city_Result_CallBack(response)
    {
    if (response.value != null)
    {
    //debugger;
    document.all("new_all_search_uiCity").length=0;    
         var ds = response.value;
    if(ds != null && typeof(ds) == "object" && ds.Tables != null)
    {
    for(var i=0; i<ds.Tables[0].Rows.length; i++)
         {
         var name=ds.Tables[0].Rows[i].Name;
           var id=ds.Tables[0].Rows[i].Sid;
           document.all("new_all_search_uiCity").options.add(new Option(name,id));
         }
    }
    }
    return
    } function areaResult() 

    var area=document.getElementById("new_all_search_uiCity");
    AjaxMethod.GetHotelList(area.value,get_area_Result_CallBack);
    }
    function get_area_Result_CallBack(response)
    {
    if (response.value != null)
    {
    document.all("new_all_search_uiHotel").length=0;    
         var ds = response.value;
    if(ds != null && typeof(ds) == "object" && ds.Tables != null)
    {
    for(var i=0; i<ds.Tables[0].Rows.length; i++)
         {
           var name=ds.Tables[0].Rows[i].Name;
           var id=ds.Tables[0].Rows[i].Sid;
           document.all("new_all_search_uiHotel").options.add(new Option(name,id));
         }
    }
    }
    return
    }
    </SCRIPT>--%>
    <script type="text/javascript">
    function Show()
    {
    document.getElementById("aaa").style.display="block";
    }
    function hide()
    {
    document.getElementById("aaa").style.display="none";
    }</script>
       <div id="left_div_1">
           <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
           </asp:ScriptManager>
           <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
               <ContentTemplate>
          <table width="190" border="0" cellspacing="0" cellpadding="0" align="center">
      <tr>
        <td colspan="2" class="browse_title">Browse by:</td>
      </tr>
      <tr><td colspan="2" height="10px;"></td></tr>
      <tr>
        <td colspan="2" style="padding-bottom:3px;"><asp:DropDownList ID="uiCountry" class="search_text"  datatextfield="Desc" datavaluefield="Sid" OnSelectedIndexChanged="uiCountry_SelectedIndexChanged" AutoPostBack="true" style="width:187px;" runat="server" /></td>
      </tr>
      <tr>
        <td colspan="2" style="padding-bottom:3px;"><asp:DropDownList ID="uiCity" class="search_text" datatextfield="Name" datavaluefield="Sid" OnSelectedIndexChanged="uiCity_SelectedIndexChanged" AutoPostBack="true" style="width:187px;" runat="server" /></td>
      </tr>
      <tr>
        <td colspan="2"><asp:DropDownList ID="uiHotel" class="search_text" datatextfield="Name" datavaluefield="Sid" OnSelectedIndexChanged="uiHotel_SelectedIndexChanged" AutoPostBack="true" style="width:187px;" runat="server" /></td>
      </tr>
        <tr><td colspan="2" height="10px;"></td></tr>
      <tr>
        <td colspan="2" class="browse_title_1">or search by keyword</td>
      </tr>
        <tr><td colspan="2" height="10px;"></td></tr>
      <tr>
        <td width="140" align="left"><asp:textbox id="keyword"   style="font:Arial; font-size:12px; color:#333333;" MaxLength="50" Columns="15" runat="server" Width="125px" AutoCompleteType="Disabled"/></td>
        <td width="50"><table width="50" border="0" cellspacing="0" cellpadding="0" height="20" class="soso_button">
            <tr>
              <td align="center">
              <asp:button id="btnSubmit" text="Search" Width="51px" onclick="btnSubmit_Click" runat="server" Height="18px" CssClass="google_search_color"/></td>
            </tr>
          </table></td>
      </tr>
        <tr><td colspan="2" height="10px;"></td></tr>
      <tr>
        <td colspan="2" class="browse_title_1">Browse Restaurants By </td>
      </tr>
        <tr><td colspan="2" height="10px;"></td></tr>
      <tr>
        <td colspan="2" align="center">
    <div style="position:relative; width:70px; height:20px;"  onmouseover="Show()" onmouseout="hide()"><table width="70" border="0" cellspacing="0" cellpadding="0" height="20" class="cuisine_button">
            <tr>
              <td align="center">Cuisine</td>
            </tr>
          </table>
      <div style="display:none;position:absolute;left:70px;top:-22px;width:500px;  border:2px solid #fff; background:#949698;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=100);" id="aaa">
    <div style="text-align:left"><cm:new_cuisine ID="new_cuisine" runat="server" /></div>
      </div>
    </div>
    </td>
      </tr>
    </table>
               </ContentTemplate>
           </asp:UpdatePanel>
          </div>代码
    可能有点多啊,不好意思
      

  3.   


    这个是index.aspx页面的<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">代码。