Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Setting web custom control properties at design time

Reply
Thread Tools

Setting web custom control properties at design time

 
 
N Kumar
Guest
Posts: n/a
 
      02-21-2006
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?
--
NK
 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      02-22-2006
Hi,

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

Here's a sample
http://msdn.microsoft.com/library/de...trolsample.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)

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


"N Kumar" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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?
> --
> NK



 
Reply With Quote
 
 
 
 
N Kumar
Guest
Posts: n/a
 
      02-23-2006
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?

--
NK


"Teemu Keiski" wrote:

> Hi,
>
> yes it is. One way is to write a composite server control.
>
> Here's a sample
> http://msdn.microsoft.com/library/de...trolsample.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)
>
> --
> Teemu Keiski
> ASP.NET MVP, AspInsider
> Finland, EU
> http://blogs.aspadvice.com/joteke
>
>
> "N Kumar" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >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?
> > --
> > NK

>
>
>

 
Reply With Quote
 
N Kumar
Guest
Posts: n/a
 
      02-23-2006
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?
--
NK


"N Kumar" wrote:

> 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?
> --
> NK

 
Reply With Quote
 
Teemu Keiski
Guest
Posts: n/a
 
      02-23-2006
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.

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

"N Kumar" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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?
>
> --
> NK
>
>
> "Teemu Keiski" wrote:
>
>> Hi,
>>
>> yes it is. One way is to write a composite server control.
>>
>> Here's a sample
>> http://msdn.microsoft.com/library/de...trolsample.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)
>>
>> --
>> Teemu Keiski
>> ASP.NET MVP, AspInsider
>> Finland, EU
>> http://blogs.aspadvice.com/joteke
>>
>>
>> "N Kumar" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> >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?
>> > --
>> > NK

>>
>>
>>



 
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
Properties pane of custom control doesn't change in design time George ASP .Net Building Controls 4 01-19-2004 01:48 AM
properties not showing in properties window at design time Peter ASP .Net Building Controls 1 12-10-2003 09:04 AM
Custom properties in a User Control at Design time Nathan Bidwell ASP .Net Web Controls 2 09-03-2003 11:58 AM
Using Table control in a custom composite control. Control does not render properly in design time. jb_in_marietta@yahoo.com ASP .Net Building Controls 1 07-02-2003 08:05 AM
Using Table control in a custom composite control. Control does not render properly in design time. jb_in_marietta@yahoo.com ASP .Net 0 07-01-2003 09:26 PM



Advertisments