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
    Registered:
    05 Sep 2008
    12 Sep 2008
    Link to this post
    Hi,

    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

    cheers

    Krishna
  2. Ivan
    Ivan avatar
    478 posts
    Registered:
    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:
    http://www.sitefinity.com/help/developer-manual/controls-get.html

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

    All the best,
    Ivan
    the Telerik team

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