Not able to set ItemClick event through usercontrol in aspx page.

2 posts, 0 answers
  1. Sunil
    Sunil avatar
    14 posts
    Member since:
    Sep 2012

    Posted 26 Mar 2012 Link to this post

    Hi there,

    Am using RadTagCloud.
    I have user control on this page with RadTagCloud,  this user control using in my aspx page.
    but ItemClick event is giving problem like Object reference not found.

    Below find my code snnipet
    code behind if UserControl 
    public partial class ucCustomerSelector : System.Web.UI.UserControl
      {
        public EventHandler rtcLinksClicks;


        protected void Page_Load(object sender, EventArgs e)
        {
        }


        protected void rtcLinks_ItemClick(object sender, Telerik.Web.UI.RadTagCloudEventArgs e)
        {
          rtcLinksClicks(sender, e);
        }


      }
    ******************************************
    code behind of aspx page
    public partial class CustomerPage : System.Web.UI.Page
      {
        


        protected void Page_Load(object sender, EventArgs e)
        {
          
          if (!Page.IsPostBack)
          {
            
            ucCustomerSelector.rtcLinksClicks += new EventHandler(myclick);
          }
        }


        private void myclick(object sender, EventArgs e)
        {
          // my logic wil come here.
        
        }
    }
    please give me solution, I am waiting for reply.
    thanks in advance.
  2. Slav
    Admin
    Slav avatar
    1356 posts

    Posted 28 Mar 2012 Link to this post

    Hello Sunil,

    I have prepared a sample page that demonstrates how to create an event of the user control and how to handle it on the main page. You can use it as a reference for incorporating this feature into your actual project.

    All the best,
    Slav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top