Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Usercontrol derived from Usercontrol without double Html Code

Reply
Thread Tools

Usercontrol derived from Usercontrol without double Html Code

 
 
Reik
Guest
Posts: n/a
 
      04-12-2005
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.


 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      04-12-2005
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



> 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.




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Derived::Derived(const Base&) and Derived& operator=(const Base&) developereo@hotmail.com C++ 1 05-23-2007 01:44 PM
Derived::Derived(const Base&) developereo@hotmail.com C++ 4 05-23-2007 09:32 AM
Derived::Derived(const Base&) and Derived& operator=(const Base&) developereo@hotmail.com C++ 1 05-23-2007 12:07 AM
Usercontrol derived from Usercontrol - masterpage init is fired tw =?Utf-8?B?Q2FwdGFpbiBTZW5zaWJsZQ==?= ASP .Net 0 02-03-2006 03:39 PM
cannot convert parameter from 'double (double)' to 'double (__cdecl *)(double)' error Sydex C++ 12 02-17-2005 06:30 PM



Advertisments