Problem loading Aspose.Form control

5 posts, 0 answers
  1. Parvinder Grover
    Parvinder Grover avatar
    4 posts
    Member since:
    May 2010

    Posted 14 Jun 2010 Link to this post

    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
  2. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 15 Jun 2010 Link to this post

    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.
  3. Parvinder Grover
    Parvinder Grover avatar
    4 posts
    Member since:
    May 2010

    Posted 16 Jun 2010 Link to this post

    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
  4. Parvinder Grover
    Parvinder Grover avatar
    4 posts
    Member since:
    May 2010

    Posted 17 Jun 2010 Link to this post

    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
  5. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 21 Jun 2010 Link to this post

    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
Back to Top