locked
Setting Control as a property of existing Control RRS feed

  • Question

  • User2032120163 posted

    Hi

    sorry if this has already been asked before but I have tried to search for the answer to no avail..

    What I want is to have in my custom WebControl a property of type WebControl, whereby when I drag my control to the page, the property will show a drop-down which lists all the other controls on the page. The reason for doing this is I have a popup control whereby I need to specify the button control which will cause it to open. So far the only way I can do this is by setting a string property on my popup control which is the id of the button, which means I then to recursively look for the control in the page. It would seem a better solution if I could pass a reference directly to the Button control. I did try and create a property of type WebControl, however in the Properties box on the page editor it does not give me a dropdown of all the controls on the web, and I am sure I have seen this with another control before so there must be a way!

    Any help would be much appreciated! 

    Thanks

    Thursday, September 1, 2011 9:24 AM

Answers

  • User1927750183 posted

    i think you are looking for this.

    http://oreilly.com/catalog/progaspdotnet/chapter/ch14.html

    http://dotnetguts.blogspot.com/2007/09/web-user-control-in-aspnet.html

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 11, 2011 10:42 AM

All replies

  • User3866881 posted

    Hello,

    Would you mind showing us your full codes?

    Thx again

    Friday, September 2, 2011 10:10 PM
  • User1927750183 posted

    i think you are looking for this.

    http://oreilly.com/catalog/progaspdotnet/chapter/ch14.html

    http://dotnetguts.blogspot.com/2007/09/web-user-control-in-aspnet.html

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 11, 2011 10:42 AM