|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Properties do not reliably persist using CompositeControlCreate a simple composite control using ASP2.0 CompositeControl class. Have two webcontrols exposed as properties, so they show as subproperties in at designtime in the properties window. Change any of the these webcontrol properties - switch to source view - none of the properties are persisted. Now, switch back to design mode, change a property of them main CompositeControl - change anything, set width to 1px and then set it back to blank. Now, go directly and change those same webcontrol properties you just tried. Switch to source view - all the properties persisted! Here is a simple webcontrol that demonstrates this: using System; using System.Collections.Generic; using System.ComponentModel; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace Sample.WebControls { [DefaultProperty("Text")] [ToolboxData("<{0}:TestCC1 runat=server></{0}:TestCC1>")] public class TestCC1 : CompositeControl { public TestCC1() { this.EnsureChildControls(); } private TextBox textBox; private Label label; [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] [PersistenceMode(PersistenceMode.InnerProperty)] [NotifyParentProperty(true)] public TextBox EditBox { get { if (this.textBox == null) this.textBox=new TextBox(); return this.textBox; } } [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] [PersistenceMode(PersistenceMode.InnerProperty)] [NotifyParentProperty(true)] public Label TextLabel { get { if (this.label == null) this.label = new Label(); return this.label; } } protected override void CreateChildControls() { this.Controls.Add(EditBox); this.Controls.Add(TextLabel); base.CreateChildControls(); } } } Wayne Brantley Hi Wayne,
I was able to reproduce the issue you described. Currently I'm doing more researching on it. I'll get back to you as soon as possible, thank you for your patience and understanding. Sincerely, Walter Wang (waw***@online.microsoft.com, remove 'online.') Microsoft Online Community Support ================================================== Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif ications. If you are using Outlook Express, please make sure you clear the check box "Tools/Options/Read: Get 300 headers at a time" to see your reply promptly. Note: The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. Please note that each follow up response may take approximately 2 business days as the support professional working with you may need further investigation to reach the most efficient resolution. The offering is not appropriate for situations that require urgent, real-time or phone-based interactions or complex project analysis and dump analysis issues. Issues of this nature are best handled working with a dedicated Microsoft Support Engineer by contacting Microsoft Customer Support Services (CSS) at http://msdn.microsoft.com/subscriptions/support/default.aspx. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. Hi all,
We've confirmed this is an issue of current version of Visual Studio 2005. The product team is aware of it now. Thanks Wayne for your feedback! Regards, Walter Wang (waw***@online.microsoft.com, remove 'online.') Microsoft Online Community Support ================================================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights.
WebParts without SharePoint
Problem accessing controls ReportViewer Causing Major Problems How to format wizard? file upload and download Formfields in Repeaters - validation and save into DB SiteMap resolve question Any way to set attributes for server controls by referencing properties/methods/variables? Enter text in at least one textbox DetailsView without DataSource |
|||||||||||||||||||||||