This is a migrated thread and some comments may be shown as answers.

SelectedIndexChanged not firing +error

2 Answers 292 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 30 Jul 2008, 08:29 PM

Here is my aspx:

                    <telerik:RadComboBox ID="RadComboBox1" Runat="server" 
                        DataSourceID="SqlDataSource1" DataTextField="addr_line_1"   
                        DataValueField="address_id" Skin="Sunset" Width="250px"   
                        OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged" AutoPostBack="True">  
                        <CollapseAnimation Duration="200" Type="OutQuint" /> 
                    </telerik:RadComboBox> 

And here is my code behind(c#):

    protected void RadComboBox1_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)  
    {  
        if (RadComboBox1.SelectedItem != null)  
            lblAddrLine1.Visible = true;  
        lblAddrLine1.Text = String.Format("Address Line 1: '{0}'", RadComboBox1.SelectedItem.Text);  
 
    } 

   
I get this error in IE7:

Line:  605
Char:  13
Error:  Sys.WebForms.PageRequestManagerServerErrorException:  An unknown error occurred while processing the request on the server.  The status code returned from the server was:  500
Code: 0
URL:  this is the url of my site

Any ideas what could be causing this?

Thanks,
Greg

2 Answers, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 31 Jul 2008, 06:36 AM

Hi Greg,

This is very strange error and we do not know what causes it. Please follow the link with possible solutions and let us known how this goes. -  http://forums.asp.net/t/1040684.aspx.

I suggest you also try our latest official build version 2008.2.723 if you use another version.

Hope this helps.

Regards,

Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Chris
Top achievements
Rank 1
answered on 31 Jul 2008, 04:58 PM
Ok,

I believe I have my problem resolved.  These are the steps that I took to get there in the hopes that this will help someone else.

I added this snippet to my scriptmanager:
EnablePartialRendering="false" 

and this will work with either the built-in ajax scriptmanager or the radscriptmanager.

Once I did this, I tried the webusercontrol embedded in my aspx page and got this:
A potentially dangerous Request.Form value was detected from the client (usercontrol_AddPerson$rcmbboxNamePrefix_Input="<none>").   
Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case.   
 
Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (usercontrol_AddPerson$rcmbboxNamePrefix_Input="<none>").  
 

Which it turns out, was another radcombobox on the same update panel which looked like this:

<telerik:RadComboBox ID="rcmbboxNamePrefix" runat="server" Skin="Sunset">  
                        <Items> 
                            <telerik:RadComboBoxItem runat="server" Text="&lt;none&gt;" /> 
                            <telerik:RadComboBoxItem runat="server" Text="Mr" /> 
                            <telerik:RadComboBoxItem runat="server" Text="Mrs" /> 
                            <telerik:RadComboBoxItem runat="server" Text="Miss" /> 
                            <telerik:RadComboBoxItem runat="server" Text="Ms" /> 
                            <telerik:RadComboBoxItem runat="server" Text="Dr" /> 
                        </Items> 
                        <CollapseAnimation Duration="200" Type="OutQuint" /> 
                    </telerik:RadComboBox> 

  I wasn't selecting anything in there and just accepting the default which was the first line for the radcomboboxitem.  I hadn't gotten to the point of building any validation yet, so the error was just showing up as my javascript error in my original post.  Turning off the partial page rendering enabled me to see the full error.  Removing the first line of the radcombobox or actually selecting another value and the error goes away.

Hope this helps somebody else.

Greg
Tags
ComboBox
Asked by
Chris
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Chris
Top achievements
Rank 1
Share this question
or