Dynamically ajaxify button.

2 posts, 0 answers
  1. JC
    JC avatar
    30 posts
    Member since:
    Feb 2013

    Posted 05 Jul 2013 Link to this post

    Hi

    There is a radgrid in my aspx page and it contains an image button. I want to dynamically ajaxify the button. Can anyone help with an example?

    Thanks
    JC
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 05 Jul 2013 Link to this post

    Hi JC,

    Please have a look at the following C# code snippet.

    C#:
    protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem dataItem = e.Item as GridDataItem;
            ImageButton ibtnAddToCart = (ImageButton)(dataItem["TemplateColumn1"]).FindControl("ibtnAddToCart");
            RadAjaxManager1.AjaxSettings.AddAjaxSetting(ibtnAddToCart, RadGrid1); //ajaxify the button
        }
    }

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top