Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / February 2006

Tip: Looking for answers? Try searching our database.

Setting web custom control properties at design time

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
N Kumar - 21 Feb 2006 12:36 GMT
I am developing a Web custom control whose properties (such as text) I would
like to map to other control properties (such as textbox1.text) or variables
of the web form at design time. Is this possible?
Signature

NK

Teemu Keiski - 22 Feb 2006 19:10 GMT
Hi,

yes it is. One way is to write a composite server control.

Here's a sample
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cp
concompositecontrolsample.asp


And here's one good article: http://aspalliance.com/359

If you use ASp.NET 2.0 see: http://dotnet.sys-con.com/read/171169.htm
(with ASP.NET 2.0 you'd inherit directly from CompositeControl base class)

Signature

Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

>I am developing a Web custom control whose properties (such as text) I
>would
> like to map to other control properties (such as textbox1.text) or
> variables
> of the web form at design time. Is this possible?
N Kumar - 23 Feb 2006 04:46 GMT
Thanks Teemu.

But I am not looking to access the child controls within the composite
control. This is definitely possible as you indicated.

What I am looking for is, I have a, say composite control with property say
Text. Now when a developer uses my control and tries to assign the Text
property through Property window, I would like to show him/her, the other
Textbox names in that web form. Say the developer has assigned (mapped) to
Textbox1, at runtime, the Text property of the composite control should take
the text value from Textbox1.

Is such a mapping possible?

Signature

NK

> Hi,
>
[quoted text clipped - 13 lines]
> > variables
> > of the web form at design time. Is this possible?
Teemu Keiski - 23 Feb 2006 20:13 GMT
Hi,

basically providing a list of controls can be done with a custom type
converter, when it would pick IDs of other controls and set such into the
property.Is that what you mean? For example similar when you set
ControlToValidate of a validator control. it shows you list of all controls
having ValidationProperty attribute applied. Yes, such is done with a custom
type copnverter.

Signature

Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

> Thanks Teemu.
>
[quoted text clipped - 30 lines]
>> > variables
>> > of the web form at design time. Is this possible?
N Kumar - 23 Feb 2006 04:58 GMT
Thanks Teemu.

But I am not looking to set the property value from child controls of the
composite control. This is very much possible as you indicated.

What I am trying to do is, say, I have a composite control with a property
Text. Now when a developer uses my control, and when he/she tries to assign
the Text property through the property window, I would like to show him a
list which has names of other Textboxes in the Web form. Now say, the
developer has assigned (mapped) it to Textbox1, then at runtime, the Text
property of Textbox1 should be assigned to the Text property of the composite
control, during initialization of the Web form.

Is this possible?
Signature

NK

> I am developing a Web custom control whose properties (such as text) I would
> like to map to other control properties (such as textbox1.text) or variables
> of the web form at design time. Is this possible?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.