More in this section

Forums / Developing with Sitefinity / Reference to the usercontrol placed on a page

Reference to the usercontrol placed on a page

2 posts, 0 answered
  1. Krishna
    Krishna avatar
    8 posts
    05 Sep 2008
    12 Sep 2008
    Link to this post

    I have created a user control and placed it on different pages in the sitefinity site. I want to read certain values of the usercontrol  from all these pages in an external page.  I loop thru all the pages and their controls. How can I get the reference to the usercontrol, as it is not a type that we can cast to?

    Please let me know if you need further clarification on my query.

    Thanks for your help


  2. Ivan
    Ivan avatar
    478 posts
    16 Jun 2015
    12 Sep 2008
    Link to this post
    Hello Krishna,

    You can actually cast to a user control, though it is not very straightforward. My suggestion is to implement an interface on these user controls (e.g. IMyControl) so you can cast the controls to the interface. To find more about finding controls on the pages you can also consult this article:

    I hope you'll find this information helpful. Let us know if there is anything else we can do for you.

    All the best,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
2 posts, 0 answered