Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Why the designer don't persist the property of my control? (Advanced)

Reply
Thread Tools

Why the designer don't persist the property of my control? (Advanced)

 
 
Umut Tezduyar
Guest
Posts: n/a
 
      11-29-2005

I have build a sample control but the designer doesn't communicate with it
to parse the childen property. Please if you are an control developer, spend
your 10 minutes to solve my problem. I have read so many articles and books
to solve it but i couldn't.

Here is the code sample:

---------- Asp Page ----------------

<form id="Form1" method="post" runat="server">
<cc1:Umut runat="server" id="umut1ew">
<Tab name="main">
<Tabs>
<cc1:Tab name="sub1"/>
<cc1:Tab name="sub2"/>
</Tabs>
</Tab>
</cc1:Umut>
</form>

--------------------------------------


------------ Class Tab-----------------

[
System.ComponentModel.TypeConverter(typeof(System. ComponentModel.ExpandableObjectConverter)), System.Web.UI.ControlBuilder(typeof(System.Web.UI. ControlBuilder)) ] public class Tab { private ArrayList _tabs; private string _name; public Tab() { } [ System.Web.UI.PersistenceMode(System.Web.UI.Persis tenceMode.InnerProperty) ] public ArrayList Tabs { get { if (this._tabs == null) this._tabs = new System.Collections.ArrayList(); return this._tabs; } set { this._tabs = value; } } [ System.Web.UI.PersistenceMode(System.Web.UI.Persis tenceMode.Attribute) ] public string Name { get { return this._name; } set { this._name = value; } } }-----------------------------------------------------Class Umut------------------- [ System.ComponentModel.Designer(typeof(System.Web.U I.Design.ControlDesigner)), System.Web.UI.ParseChildren(true) ] public class Umut : System.Web.UI.Control { private Tab _tab; public Tab Tab { get { if (this._tab == null) { this._tab = new Tab(); this._tab.Name = "Default"; } return this._tab; } set { this._tab = value; } } protected override void Render(System.Web.UI.HtmlTextWriter writer) { this.RenderTab (writer, this.Tab); } private void RenderTab(System.Web.UI.HtmlTextWriter writer, Tab tab) { writer.Write (string.Format (">>Tab name={0}<br>", tab.Name)); foreach (Tab t in tab.Tabs) this.RenderTab (writer, t); } }-----------------------------------------------------------------

 
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
Designer Property Serialization -- Sycning inner properties to designer property window Alexander Higgins ASP .Net Building Controls 3 07-30-2007 09:09 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Why the designer doesn't persist the property of my control? (Advanced) Umut Tezduyar ASP .Net 0 12-02-2005 05:16 PM
Why the designer doesn't persist the property of my control? (Advanced) Umut Tezduyar ASP .Net Web Controls 0 12-02-2005 05:16 PM
Why the designer don't persist the property of my control? (Advanced) Umut Tezduyar ASP .Net Web Controls 0 11-29-2005 01:04 AM



Advertisments