ajaxify specific controls dynamically ArgumentNullException no page parameter

7 posts, 0 answers
  1. Rich
    Rich avatar
    65 posts
    Member since:
    Jul 2012

    Posted 25 May 2010 Link to this post

    Hi All,

    I am attempting to ajaxify specific controls dynamically. I have a repeater and i want to ajaxify image buttons inside the repeater.

    On ItemCreated for the repeater i am:

    protected void RptCategories_ItemCreated(object sender, RepeaterItemEventArgs e)
            {
                if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
                {
                    ImageButton imgbtn = (ImageButton)e.Item.FindControl("iBtnRemoveCategory");
                    this.RadAjaxManager1.AjaxSettings.AddAjaxSetting(imgbtn, RptCategories, RadAjaxLoadingPanel1);
                }
            }

    The line where i am adding the AjaxSetting i am getting the error: ArgumentNullException was unhandled by user code, value cannot be null, Parameter Page.

    It seems the RadAjaxManager doesn't know where it is.. this is a form page with a masterpage.. no usercontrols..Please help. THanks.

  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 28 May 2010 Link to this post

    Hi Rich,

    Note that you should always add AJAX pair dynamically in a Page event handler, which is executed each time during the page lifecycle (Page_Load, Page_PreRender) so that the control could be ajaxified when the page is initially loaded. Please review the following help topic which elaborates on this scenario.


    Sincerely yours,
    Maria Ilieva
    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. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rich
    Rich avatar
    65 posts
    Member since:
    Jul 2012

    Posted 28 May 2010 Link to this post

    Hi The buttons are inside a Repeater.. so how would i add dynamically in the page load or prerender? The repeater is likely not databound at this point.



  5. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 31 May 2010 Link to this post

    Hello Rich,

    I would suggest you to wrap the Repeater into an asp Panel and add the whole Panel to update itself on Page_Load or Page_PreRender events. Check it out and let me know if it makes any difference.


    Best wishes,
    Maria Ilieva
    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.
  6. Rich
    Rich avatar
    65 posts
    Member since:
    Jul 2012

    Posted 31 May 2010 Link to this post

    What do you mean when you say:

    "add the whole Panel to update itself on Page_Load or Page_PreRender events"??

    thanks
  7. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 31 May 2010 Link to this post

    Hi Rich,

    Your settings should look like this:

    ASPX:
    <asp:Panel ID="Panel1" runat="server">
                <asp:Repeater ID="RptCategories" runat="server">
                </asp:Repeater>
    </asp:Panel>

    CS:
    protected void Page_Load(object sender, EventArgs e)
        {
            this.RadAjaxManager1.AjaxSettings.AddAjaxSetting(Panel1, Panel1, RadAjaxLoadingPanel1); 
        }




    Best wishes,
    Maria Ilieva
    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.
  8. James
    James avatar
    4 posts
    Member since:
    Apr 2012

    Posted 19 Aug 2013 Link to this post

    For our situation, the fix was to put the RadAjaxManager.AjaxSettings.AddAjaxSetting after adding the panel to the Controls (Controls.Add(panel)).
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017