Hi,
(Sorry, I replied to you, not the group. My apologies. Here it is again for
the group.)
Maybe with an example....
Say I am developing a search interface but I don't want the developers down
the line to know how the search routines work. I create the user control
that the developers can drop onto their page. I want them to be able to
style/design the interface as tehy see fit, plus also to have codebehind
that they can manipulate the interface controls themself, such as make
links, textboxes etc visible.
So, there is a button event. I can bubble the event up and this works.
However, that button event does manipulation to the interface, such as allow
a datalist to appear or hide or show labels. This has to happen at the base
class level.
I could potentially write all the controls on the ascx as derived controls
that react accordingly, but that is likely to be heavy in coding, whereas if
I can manipulate the controls from my base class would make it so much
easier.
Any help would be much appreciated, even if it is to say it cannot be done
and to look at the alternative route (ideas for alternative routes would be
very welcome as well).
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:ed**************@TK2MSFTNGP04.phx.gbl...
What you should do is express the problem you see with having the classes
"open" for other developers to alter, as I am not sure I fully understand
the problem. As long as the controls leave things in the base class, the
base class method will be used. If the person overrides a behavior, it
will no longer come from the base class unless the person explicitly calls
down the stack.
It sounds, to me, like you want the ability to do this
protected override void LinkButton1Message(string message)
And not call the base LinkButton1Message, but still have the message hook
up? If so, you are never going to achieve this. The norm is ...
base.LinkButton1Message = message
If you do not override, you can access directly, but you cannot do it if
you override and do not call the base method.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com/
*************************************************
Think Outside the Box!
*************************************************
"David" <da*****************@revilloc.REMOVETHIS.comwrot e in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>Hi all,
I am trying to write a user control. On this control, I just have
linkbuttons.
The codebehind has to inherit from my baseclass which inherits from
usercontrol.
e.g.
mypage.ascx inherits from mypage.ascx.cs
mypage.ascx.cs inherits from mybaseclass
mybaseclass inherits from system.web.ui.usercontrol
What I want to do is to allow people to use overrides in the usercontrol
while keeping the mybaseclass safe. I have seen this done before but I am
having problems. While the scenario above appears to be working so far,
what I now need to do is to manipulate the linkbuttons from mybaseclass,
however, I am having problems with it.
What I don't want to do is to type any more code into the mypage.ascx.cs.
It all has to happen from mybaseclass.
How do I do this? I have tried a number of things, such as findcontrol, I
have even declared the linkbuttons in the base class, all to no avail.
Thanks for any help you can give.
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available