This is a migrated thread and some comments may be shown as answers.

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

1 Answer 52 Views
TagCloud
This is a migrated thread and some comments may be shown as answers.
Sunil
Top achievements
Rank 2
Sunil asked on 26 Mar 2012, 12:00 PM
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.

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 28 Mar 2012, 04:23 PM
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.
Tags
TagCloud
Asked by
Sunil
Top achievements
Rank 2
Answers by
Slav
Telerik team
Share this question
or