Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > please, add design time attributes to my control.

Reply
Thread Tools

please, add design time attributes to my control.

 
 
Umut Tezduyar
Guest
Posts: n/a
 
      11-23-2005
I really hate working with .net framework design time attributes. I have
read asp.net server controls and components (Nikhil Kothari, Vandana Datye)
book, chapter 15 but still i can't handle the complex tasks on designer. The
thing i want to do is so simple (I hope so). I want my control to understand
the Menu and SubMenus under Menu. Ex:

<cc1:MyConrol runat="server" id="MyControl1">
<Menu name="level1">
<SubMenus>
<Menu name="level2">
<SubMenus>
<Menu name="level3"/>
</SubMenus>
</Menu>
<Menu name="level4"/>
</SubMenus>
</Menu>
</cc1:MyControl>

It should parse child controls and also by using the property browser, i
should add 'Menu' and 'SubMenus' to my control. Should i use
'ExpandableObjectConverter' for my MyControl control?

Could you please fully decorate this control and Menu to give a full design
time support?

Here is the code:

[ToolboxData("<{0}:MyControl runat=server></{0}:MyControl>")]
public class MyControl : System.Web.UI.Control
{
private Menu _menu;

// This is not the only propery. Not DefaultInnerPropery
public Menu Menu
{
get
{
return this._menu;
}
set
{
this._menu = value;
}
}
}

// This is not a control
public class Menu
{
private string _name;

// Menu collection is a collection only holds Menu in it.
private MenuCollection _subMenus;

public Menu()
{

}

public string Name
{
get
{
return this._name;
}
set
{
this._name = value;
}
}

public MenuCollection SubMenus
{
get
{
return this._subMenus;
}
set
{
this._subMenus = value;
}
}

}


 
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
Design-Time Attributes are not working Nathan Sokalski ASP .Net 0 01-05-2008 03:52 AM
Using Design-Time Attributes with CustomControls Nathan Sokalski ASP .Net 0 01-03-2008 09:18 PM
WebControl.Attributes.Add and custom attributes P4trykx ASP .Net 2 01-31-2007 04:33 PM
WebControl left top attributes (design-time) niboew ASP .Net 1 05-13-2006 02:06 PM
Could you please decorate it with design time attributes? Umut Tezduyar ASP .Net 0 11-22-2005 07:37 PM



Advertisments