|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Usercontrol derived from Usercontrol without double Html CodeHi everyone,
lets say I have written a usercontrol called url.ascx. The Html portion of this usercontrols contains a single textfield to enter a URL. The entered URL is handled in the code behind, checked for syntax bla bla.. Now Iam writing a second usercontrol called link.ascx that derives from url. In link.ascx I have another textfield where the user can enter the text of a link. Still I want to display the textfield for the URL. So basically I want the Html from the url.ascx to be displayed above the link.ascx. Also if the Page is posted, I want the codebehind in url.ascx to validate the user input in the url textbox and the codebehind for link.ascx to handle the user input in the linktext textbox. Is that possible? I dont wanna double all the Html code when deriving a usercontrol. You should use containment not inheritance. Have link.ascx create an instance
of url.ascx via the LoadControl API. -Brock DevelopMentor http://staff.develop.com/ballen Show quoteHide quote > Hi everyone, > lets say I have written a usercontrol called url.ascx. The Html > portion of > this usercontrols contains a single textfield to enter a URL. The > entered URL > is handled in the code behind, checked for syntax bla bla.. > Now Iam writing a second usercontrol called link.ascx that derives > from url. > In link.ascx I have another textfield where the user can enter the > text of a > link. Still I want to display the textfield for the URL. So basically > I want > the Html from the url.ascx to be displayed above the link.ascx. Also > if the > Page is posted, I want the codebehind in url.ascx to validate the user > input > in the url textbox and the codebehind for link.ascx to handle the user > input > in the linktext textbox. Is that possible? I dont wanna double all the > Html > code when deriving a usercontrol.
IE Web Controls - discontinued ???
custom validator and button events custom validator and button events Re: At which life cycle should EnsureChildControls() be called? Cant Render Page Control with Visual Studio 2005 Beta Control Template How do I post hidden variables to another form from a popup? Custom Templated Control not rendering asp.net controls correctly Printed Monthly Calendar Controls DataGrid1 UpdateCommand calling DataGrid2 UpdateCommand |
|||||||||||||||||||||||