Click here to Skip to main content
15,917,177 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
i have a drop down list in my aspx page.in that i have selected the value like "abc's"
the i am getting the below error.



sys.WebForms.PageRequestManagerParserErrorException:The Message received from the server could not be parsed.Common Causse for this error are when the response is modified by calls to Response,Write(),response filters,HTTPModules,or Server trace is enables.

Details:Error parsing near'
<!DOCTYPE html P'.



my output should be one more dropdown should be display based on selection.

if i select "abc"s" it is not giving above error and populating other drop down list which is correct.
Posted
Comments
Zubair Alie 9-Sep-13 7:01am    
you might have some issue running with your definitions...
See

<!DOCUMENTTYPE html.......

Copy and paste your page headers inside your question area. it seems you are misplacing something there.
kanna443 13-Sep-13 4:54am    
Thanks for your suggestion.
they used following page headers.
Calendar JS/xc2_default.js
Calendar JS/xc2_inpage.js
Calendar JS/xc2_default.css
App_themes/jquery-latest.js


and ajax tool kit also
kanna443 13-Sep-13 6:00am    
code:

asp:-

<asp:DropDownList ID="ddHT" TabIndex="14" runat="server" Width="250px" AutoPostBack="true" OnSelectedIndexChanged="ddHT_SelectedIndexChanged" onchange="showMsg=false;showCategory('TYPE');">



function showCategory(strDDType)
{

var SelectedTypeVal = $get('<%=ddHT.ClientID %>').options[IndexValue].text;
}

//the above said error occurs before going to .cs page change event.
it is working fine when my drop down value like " abc"s ".means some thing is stopping when the drop down value having ' (Apostrophe)
//note:- i m not using selected text in my aspx page.only using my index(id of selected value).
aspx.cs:-

protected void ddHT_SelectedIndexChanged(object sender, EventArgs e)
{
HType objHTYpe = new HType();
if (ddHT.SelectedIndex != 0)
{

int HTypeId = Convert.ToInt32(ddHT.SelectedValue);
}

}


Appreciate any help :)
kanna443 13-Sep-13 12:43pm    
problem is coverting replace the function in Page_Load()

List.RowFilter = "Type = '" + ddHType.SelectedItem.Text.Replace(" ' ", "") + " ' ";

Issue resolved.

thanks

 
Share this answer
 
Comments
kanna443 13-Sep-13 4:57am    
thanks but my problem is not from database. i m getting popup error before fire the dropdown "onchange" event in aspx.cs
try this hope this will help you

public DataTable fill(string query)
{
con.Open();
SqlDataAdapter adap = new SqlDataAdapter(query, con);
DataTable dt = new DataTable();
adap.Fill(dt); con.Close();
return (dt);
}




public DataTable Brand_Name(string group)
{
string query = "Select distinct Brand_Name from Brand_Master where Group_Name='"+group +"'";
DataTable dt = fill(query);
return dt;
}


C#
protected void Group_Name_SelectedIndexChanged(object sender, EventArgs e)
       {
           string group = Group_Name.Text;
           DataTable dt =Brand_Name(group);
           Brand_Name.Items.Clear();
           Brand_Name.Items.Add("--Select--");

           for (int i = 0; i < dt.Rows.Count; i++)
           {
               Brand_Name.Items.Add(dt.Rows[i]["Brand_Name"].ToString());
           }
       }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900