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

RadAjaxPanel in WebUserControl

6 Answers 157 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
GrZeCh
Top achievements
Rank 2
GrZeCh asked on 25 Jun 2008, 01:02 PM
Hello!

I have RadComboBox in RadAjaxPanel which is in WebUser Control. I use this WebUserControl on main page and on subpage. On main page it is working without problems but when I try to postback (selection item from RadComboBox) on subpage I'm getting this error in JavaScript error console (Firefox 3.0):

Error: [Exception... "Access to restricted URI denied"  code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)"  location: "http://mypagedomain.com/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_easyRadScriptManager_HiddenField&_TSM_CombinedScripts_=%3b%3bTelerik.Web.UI%2c+Version%3d2008.1.619.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-GB%3a4364035f-7a19-4477-bb96-de2f05499ebe%3afe8d4455%3adcf52240%3afe3916f2%3a9265f342%3a6e6298e2%3a170a45d3%3a3e33fb52%3a5f3d0562%3ac7991a52%3afe26d610%3a84b3a4b9 Line: 4935"
Source file: http://mypagedomain.com/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_easyRadScriptManager_HiddenField&_TSM_CombinedScripts_=%3b%3bTelerik.Web.UI%2c+Version%3d2008.1.619.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-GB%3a4364035f-7a19-4477-bb96-de2f05499ebe%3afe8d4455%3adcf52240%3afe3916f2%3a9265f342%3a6e6298e2%3a170a45d3%3a3e33fb52%3a5f3d0562%3ac7991a52%3afe26d610%3a84b3a4b9 
Line: 4935 

Thanks

6 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 27 Jun 2008, 01:24 PM
Hello GrZeCh,

I tested this scenario, but no error occurred on my side. Could you please elaborate a little bit more on your project configuration settings? What are your Ajax settings? How do you trigger the Ajax request? Posting the code from your application will help us track the issue and hopefully provide a solution.

Best regards,
Maria Ilieva
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
GrZeCh
Top achievements
Rank 2
answered on 27 Jun 2008, 07:57 PM
ASPX:
    <telerik:RadAjaxPanel ID="searchRadAjaxPanel" LoadingPanelID="easyRadAjaxLoadingPanel" 
        runat="server" Height="100px" Width="300px"
        <table style="width: 300px"
            <tr> 
                <td style="width: 110px"
                    Country: 
                </td> 
                <td class="border" style="border: 0px"
                    <telerik:RadComboBox ID="countryRadComboBox" runat="server" AllowCustomText="True" 
                        MarkFirstMatch="True" Skin="Sunset" ValidationGroup="searchValidation" Width="180px" 
                        DataSourceID="countryObjectDataSource" DataValueField="id_country" DataTextField="name" 
                        EmptyMessage="Select country" OnSelectedIndexChanged="countryRadComboBox_SelectedIndexChanged" 
                        AutoPostBack="true"
                        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                    </telerik:RadComboBox> 
                    <asp:RequiredFieldValidator ID="countryRequiredFieldValidator" ControlToValidate="countryRadComboBox" 
                        Display="Dynamic" runat="server" ErrorMessage="RequiredFieldValidator" ValidationGroup="searchValidation"></asp:RequiredFieldValidator> 
                    <asp:ObjectDataSource ID="countryObjectDataSource" runat="server" OldValuesParameterFormatString="original_{0}" 
                        SelectMethod="GetData" TypeName="EasyInternetCafe.EasyInternetCafeDataSetTableAdapters.eic_countryTableAdapter"
                    </asp:ObjectDataSource> 
                </td> 
            </tr> 
            <tr> 
                <td> 
                    City: 
                </td> 
                <td> 
                    <telerik:RadComboBox ID="cityRadComboBox" runat="server" AllowCustomText="True" MarkFirstMatch="True" 
                        Skin="Sunset" ValidationGroup="searchValidation" Width="180px" DataValueField="id_city" 
                        DataTextField="name" EmptyMessage="Select city" Enabled="false" AutoPostBack="True" 
                        OnSelectedIndexChanged="cityRadComboBox_SelectedIndexChanged"
                        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                    </telerik:RadComboBox> 
                </td> 
            </tr> 
            <asp:PlaceHolder ID="othercityPlaceHolder" runat="server" Visible="false"
                <tr> 
                    <td> 
                        Type city name: 
                    </td> 
                    <td> 
                        <telerik:RadTextBox ID="othercityRadTextBox" runat="server"
                        </telerik:RadTextBox> 
                        <asp:RequiredFieldValidator ID="othercityRequiredFieldValidator" ControlToValidate="othercityRadTextBox" 
                            Display="Dynamic" runat="server" ErrorMessage="RequiredFieldValidator" ValidationGroup="searchValidation"></asp:RequiredFieldValidator> 
                    </td> 
                </tr> 
            </asp:PlaceHolder> 
            <tr> 
                <td> 
                </td> 
                <td> 
                    <asp:Button ID="searchButton" runat="server" Text="Search" ValidationGroup="searchValidation" 
                        OnClick="searchButton_Click" /> 
                </td> 
            </tr> 
        </table> 
    </telerik:RadAjaxPanel> 
    <telerik:RadAjaxLoadingPanel ID="easyRadAjaxLoadingPanel" runat="server" Height="75px" 
        Width="75px"
        <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' 
            style="border: 0px;" /> 
    </telerik:RadAjaxLoadingPanel> 

C#:
        protected void countryRadComboBox_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) 
        { 
            eicDataSetTableAdapters.eic_cityTableAdapter cityTableAdapter = new eic_cityTableAdapter(); 
            cityRadComboBox.DataSource = cityTableAdapter.GetDataByCountry(int.Parse(e.Value)); 
            cityRadComboBox.DataBind(); 
            cityRadComboBox.Enabled = true
            cityRadComboBox.Items.Add(new RadComboBoxItem("Other""0")); 
        } 
 
        protected void searchButton_Click(object sender, EventArgs e) 
        { 
            if (othercityRadTextBox.Text.Length == 0) 
            { 
                if (cityRadComboBox.SelectedIndex == -1) 
                { 
                    Response.Redirect(string.Format("~/search.aspx?country={0}", countryRadComboBox.SelectedValue)); 
                } 
                else 
                { 
                    Response.Redirect(string.Format("~/search.aspx?city={0}", cityRadComboBox.SelectedValue)); 
                } 
            } 
            else 
            { 
                Encoding iso = Encoding.GetEncoding("iso8859-1"); 
                byte[] isoBytes = iso.GetBytes(othercityRadTextBox.Text.Replace(" ""__")); 
                Response.Redirect(string.Format("~/search.aspx?gcity={0}___{1}", iso.GetString(isoBytes), countryRadComboBox.SelectedItem.Text.Replace(" ""__"))); 
            } 
        } 
 
        protected void cityRadComboBox_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) 
        { 
            if (int.Parse(e.Value) == 0) 
            { 
                othercityPlaceHolder.Visible = true
            } 
            else 
            { 
                othercityPlaceHolder.Visible = false
            } 
        } 

Thats all





0
Maria Ilieva
Telerik team
answered on 01 Jul 2008, 07:34 AM
Hi GrZeCh,

I reviewed your code, but was not able to notice any reasons for the error you are facing.

Could you please try to wrap the AJAXified controls in a regular asp UpdatePanel instead of RadAjaxPanel and see if the error appears again?

Kind regards,
Maria Ilieva
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
GrZeCh
Top achievements
Rank 2
answered on 01 Jul 2008, 07:59 AM
I've changed RadAjaxPanel to UpdatePanel and now it works.
0
Maria Ilieva
Telerik team
answered on 01 Jul 2008, 01:33 PM
Hello,

I noticed in your code that you are adding an invisible PlaceHolder into the RadAjaxPanel. Actually it is not recommended to ajaxify controls that do not render any HTML and which are initially invisible on the page. Could you please try to add the controls nested into the PlaceHolder into another (for example regular asp panel) visible container and after that wrap them with the RadAjaxPanel.

Let us know how it goes.

Greetings,
Maria Ilieva
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Ryan
Top achievements
Rank 1
answered on 24 Feb 2009, 05:35 PM
My problem was very similar, arising from setting the UserControl's Visible to false and then making it Visible again later in the page cycle. I fixed this problem by making the UserControl Visible earlier in the life cycle, specifically the PreInit phase.
Tags
Ajax
Asked by
GrZeCh
Top achievements
Rank 2
Answers by
Maria Ilieva
Telerik team
GrZeCh
Top achievements
Rank 2
Ryan
Top achievements
Rank 1
Share this question
or