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

Problem loading Aspose.Form control

4 Answers 94 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Parvinder Grover
Top achievements
Rank 1
Parvinder Grover asked on 14 Jun 2010, 07:59 PM
Hi,

I'm evaluating Telerik RadControls in a web application. On a RadComboBox change I display another third party control (Aspose.Form) that show my InfoPath forms. I need to view them and on Save button on my page, I want to save that form. However I'm just stuck just getting it loaded on dropdown change event. I get this message: 
"Error: Sys.WebForms.PageRequestManagerServerErrorException: Multiple controls with the same ID 'x0' were found. FindControl requires that controls have unique IDs" as shown in the attachment. 

My usage of controls in .aspx is:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadComboBox1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="XmlFormView1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
</telerik:RadAjaxManager>

        <telerik:RadComboBox ID="RadComboBox1" runat="server" 
            AutoPostBack="true" 
            onselectedindexchanged="RadComboBox1_SelectedIndexChanged" 
            Label="Please select a form:" Width="200px">
        <Items> 
        <telerik:RadComboBoxItem Text="" Value="" />
        <telerik:RadComboBoxItem Text="AST Monthly Inspection Checklist" Value="1" />
        <telerik:RadComboBoxItem Text="Book1PMIQAL CHECKLIST" Value="2" />
        </Items>
        </telerik:RadComboBox>

And in codebehind, I have:
    protected void RadComboBox1_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
    {

        //Getting error on DDL change: 
        //Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Multiple controls with the same ID 'x0' were found. FindControl requires that controls have unique IDs.
        try
        {
            XmlFormView1.Controls.Clear();
            XmlFormView1.Reset();
            if (int.Parse(RadComboBox1.SelectedItem.Value) > 0)
            {
                XmlFormView1.XsnLocation = Server.MapPath("Forms/" + RadComboBox1.SelectedItem.Text + ".xsn");
                XmlFormView1.XmlDataString = GetFormDataByID(int.Parse(RadComboBox1.SelectedItem.Value));
            }
            XmlFormView1.RefreshData();
        }
        catch (Exception)
        {
            
            throw;
        }
    }

Sample project can be sent on request so that you can reproduce it.

Thank you,
Parvinder

4 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 15 Jun 2010, 09:49 AM
Hi Parvinder Grover,

The error message indicates that a control is added twice (or more) on the page with the same ID - 'x0'. Since the RadComboBox and RadAjaxManager have other IDs then the culprit could be a control that XmlFormView1 puts on the page. Please bear in mind that this is only an assumption as I am unfamiliar with the Aspose.Form control and how it works.

So before continuing further, please try replacing the RadComboBox with a DropDownList and then the RadAjaxManager with an UpdatePanel in order to see whether the issue exists after the replacements or not. If it still exists, then it is most probably related to the Aspose.Form control. Otherwise, please send us a sample project via s support ticket - we will look into it on our side right away.

Greetings,
Simon
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Parvinder Grover
Top achievements
Rank 1
answered on 16 Jun 2010, 07:01 PM
Thanks, Simon, for the reponse. You were right. It was indeed had to do with Aspose.Form control. I had to add a Clear Form button to cause additional postback and call 'XmlFormView1.Controls.Clear()' method in that button click. There is a feature request to get rid of this additional requirement of postback for clearing control. Regards, Parvinder
0
Parvinder Grover
Top achievements
Rank 1
answered on 17 Jun 2010, 06:08 PM
Dear support,

To be able to use Aspose.Form in my Telerik based web application for content pages and user controls, I have to set <xhtmlConformance mode="Legacy"/>. When I do that I get error message: 
Line: 96
Error: 'Sys.WebForms.PageRequestManager' is null or not an object

Is there a way to use RadControls for ASP.NET AJAX in the above legacy xhtml mode?

Thanks,
Parvinder
0
Simon
Telerik team
answered on 21 Jun 2010, 05:04 PM
Hello Parvinder Grover,

Since RadControls are based on the ASP.NET AJAX Framework, you will not be able to run them in this mode and you may need to switch to 'Transitional' (more info here).

Kind regards,
Simon
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
ComboBox
Asked by
Parvinder Grover
Top achievements
Rank 1
Answers by
Simon
Telerik team
Parvinder Grover
Top achievements
Rank 1
Share this question
or