Dynamic RadGrid and OnRowDeleted AJAX error

7 posts, 0 answers
  1. Bruce
    Bruce avatar
    23 posts
    Member since:
    Sep 2008

    Posted 08 Jul 2009 Link to this post

    I am having a bad time with AJAX request and error message after first OnRowDeleted function call: "Multiple controls with the same ID 'ctl00' were found. FindControl requires that controls have unique IDs."

    I build my radtabstrip and radpages and radgrids on pageload.

    here is my code for code behind.

     Public Function gametemplate(ByVal dt As Data.DataTable) As RadGrid 
                Dim g As New RadGrid 
                g.ID = System.Guid.NewGuid.ToString 
                ' g.EnableViewState = False 
     
                g.AutoGenerateColumns = False 
                g.Skin = "Gray" 
                g.MasterTableView.DataKeyNames = New String() {"gameid"
                g.MasterTableView.ClientDataKeyNames = g.MasterTableView.DataKeyNames 
                g.MasterTableView.AllowAutomaticDeletes = "true" 
                g.ClientSettings.ClientEvents.OnRowDeleted = "deleteGame" 
     
     
                Dim hColumn As New GridBoundColumn 'home team 
                Dim aColumn As New GridBoundColumn 'away team 
                Dim sColumn As New GridBoundColumn 'gametime 
                Dim statusColumn As New GridBoundColumn 'status of game 
                Dim deleteC As New GridClientDeleteColumn 
                deleteC.ImageUrl = "/images/cross.png" 
                deleteC.ConfirmText = "Are you sure you want to remove game from schedule?" 
                deleteC.ButtonType = GridButtonColumnType.ImageButton 
                deleteC.UniqueName = "deleteit" 
                'Dim templateColumnName As String = "Delete" 
                'Dim templateColumn As New GridTemplateColumn() 
                'templateColumn.ItemTemplate = New MyTemplate(templateColumnName) 
                'templateColumn.HeaderText = templateColumnName 
     
                'Dim dColumn As New GridTemplateColumn() ' delete it 
                'dColumn.HeaderText = "Delete" 
     
                'Dim dButton As New GridImageButton(dColumn) 
                'dButton.ImageUrl = "/images/cross.png" 
                'dButton.OnClientClick = "return confirm('you da man');" 
                'dColumn.ItemTemplate.InstantiateIn(dButton) 
     
     
                With statusColumn 
                    .HeaderText = "Status" 
                    .DataField = "status" 
                    .UniqueName = "status" 
                End With 
                hColumn.UniqueName = "hometeam" 
                hColumn.DataField = "hometeam" 
                hColumn.HeaderText = "Home" 
                aColumn.DataField = "awayteam" 
                aColumn.UniqueName = "awayteam" 
                aColumn.HeaderText = "Away" 
                sColumn.DataField = "start" 
                sColumn.UniqueName = "start" 
                sColumn.HeaderText = "Start" 
     
                g.MasterTableView.Columns.Add(sColumn) 
                g.MasterTableView.Columns.Add(hColumn) 
                g.MasterTableView.Columns.Add(aColumn) 
                g.MasterTableView.Columns.Add(statusColumn) 
                g.MasterTableView.Columns.Add(deleteC) 
                'g.Columns.Add(templateColumn) 
     
                g.DataSource = dt 
                g.DataBind() 
                Return g 
     
            End Function 
     
            Protected Sub createFieldTabs() 
                Dim fields As bo.fieldlist = fbll.getTournamentFields(Me.tournamentid) 
               
                If fields.Count >= 1 Then 
                    For Each f As bo.Field In fields 
                        Dim newtab As New RadTab 
     
                        Dim newpage As New RadPageView 
     
     
     
                        newtab.Text = f.name 
                        newtab.PageViewID = newpage.ID 
     
                        newpage.Controls.Add(Me.gametemplate(gbll.getGamesForField(Me.tournamentid, f.fieldid))) 
     
                        fieldpages.PageViews.Add(newpage) 
     
                        fieldtabs.Tabs.Add(newtab) 
     
                        If fields.IndexOf(f) <= 0 Then fieldpages.SelectedIndex = newtab.Index 
                    Next 
     
                  
     
     
                End If 
     
            End Sub 

    Here is my aspx page:

    <%@ Page Language="VB" MasterPageFile="~/masters/SubPage.master" AutoEventWireup="false" CodeFile="tabs.aspx.vb" Inherits="thunder.apps.sa.pages.scheduletabs" title="Untitled Page" %> 
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"
     <sa:TournamentTools ID="TournamentTools1" runat="server" /> 
         <div style="clear:both;height:20px;"></div>  
     <telerik:RadCodeBlock ID="cb1" runat="server"
     
     
        <script language="javascript" type="text/javascript"
        var ajaxManager ; 
        function setManager(){ 
       ajaxManager = $find("<%= RadAjaxManager3.ClientID %>"); 
        } 
         function deleteGame(sender, eventArgs) 
        { 
           var gameid = eventArgs.getDataKeyValue("gameid"); 
           setManager(); 
          
           ajaxManager.ajaxRequest(gameid); 
             
        } 
     
        </script> 
        
       </telerik:RadCodeBlock> 
        <telerik:RadAjaxManager RequestQueueSize="2" EnableAJAX="true"   ID="RadAjaxManager3" runat="server"
        </telerik:RadAjaxManager> 
        
    <fieldset><legend>Tournament Schedule</legend> 
     
     
        <telerik:RadTabStrip ID="fieldtabs" Skin="Gray" MultiPageID="fieldpages" runat="server"
        <Tabs> 
         
        </Tabs> 
         
        </telerik:RadTabStrip> 
        <telerik:RadMultiPage ID="fieldpages" runat="server"
             
        </telerik:RadMultiPage> 
    </fieldset> 
     
    </asp:Content> 
     
     

  2. Bruce
    Bruce avatar
    23 posts
    Member since:
    Sep 2008

    Posted 08 Jul 2009 Link to this post

    here is the ajaxrequest function:

     
            Protected Sub RadAjaxManager3_AjaxRequest(ByVal sender As ObjectByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles RadAjaxManager3.AjaxRequest 
                Try 
                    gbll.deleteGame(Convert.ToInt32(e.Argument)) 
                    'RadAjaxManager3.Alert("Game deleted.") 
     
                Catch ex As Exception 
     
                End Try 
     
     
            End Sub 

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2285 posts

    Posted 14 Jul 2009 Link to this post

    Hello Bruce,

    Unfortunately we were able to reproduce the problem and will need a bit more time to investigate.
    I will update the thread as soon as we  have any details on the behavior.

    All the best,
    Nikolay
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Terry
    Terry avatar
    2 posts
    Member since:
    Oct 2012

    Posted 16 Sep 2009 Link to this post

    Hello,

    Did you find a solution to this issue?

    We are receiving this error: 
    Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Multiple controls with the same ID 'ctl00' were found. FindControl requires that controls have unique IDs.

    This occurs when we click the Update Button on a GridTemplateForm.  The grid is on a user control which is added to a page dynamically.

    Thanks,

    TFISHER
  6. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2285 posts

    Posted 22 Sep 2009 Link to this post

    Hello Terry,

    Could you please open formal support ticket and send us runnable project that replicates the issue?
    We will do our best to help you to attain the functionality in your particular scenario.

    Sincerely yours,
    Nikolay
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. cyfirst
    cyfirst avatar
    11 posts
    Member since:
    Sep 2009

    Posted 10 Feb 2010 Link to this post

    Was there any resolution to this issue?  If there was would you please share the resolution as I am experiencing the same error when updating a table.
    Thanks
  8. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2285 posts

    Posted 15 Feb 2010 Link to this post

    Hello cyfirst,

    Could you please provide a bit more information for your scenario. Thus we'll be able to help you resolve the behavior which you are observing.

    Kind regards,
    Nikolay
    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
UI for ASP.NET Ajax is Ready for VS 2017