Ask a Question related to ASP.NET, Design and Development.
-
Steve #1
Using ParseChildren attribute to load child tags - VS removes tags
I am building a poll control, nested in the tag I have child tags to setup
the poll options.
Everything works fine, but when I edit a property in VS design mode, VS
removes the child tags.
C# Code:
[ParseChildren(true, "Options")]
public class PollForm : Control, INamingContainer
{
private ArrayList options = new ArrayList();
public ArrayList Options
{
get { return options; }
}
}
public class Option
{
private string text;
public string Text
{
get { return text; }
set { text = value; }
}
}
Tags:
<MyTag:PollForm id=”poll1” runat="server">
<MyTag:Option Text=”Option 1” />
<MyTag:Option Text=”Option 2” />
</MyTag:PollForm>
How do I stop VS removing the child tags?
Steve Guest
-
unlock head tags on child page based on template
Is there a way to unlock the head tags and body tag of a child page that is based on a template? I can insert Flash Video on the template page, I... -
How to treat template tags as comment tags?
Hi all, I am using DW MX to edit templates for a FreeMarker application. The template tag fromat is like so: <ul> <#list birds as bird>... -
Help needed. I Cannot find TITLE attribute for A tags
Can anybody tell me how I can edit/add TITLE attributes in A tags? I cannot find this anywhere. Thanks Rob -
My Own Tags
I am currently working on a modular system where I need to implement SNIPPETS. I need to be able to write on my php pages something like ], so that... -
Alt tags
You want the alt attribute to be the same color as the background color of the cell? I'm not sure what you are asking for. The alt attribute is... -
Victor Garcia Aprea [MVP] #2
Re: Using ParseChildren attribute to load child tags - VS removes tags
Hi Steve,
Take a look at the PersistChildren attribute.
--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
[url]http://obies.com/vga/blog.aspx[/url]
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.
"Steve" <Steve@Dot.Net> wrote in message
news:ubFs26oSDHA.3768@tk2msftngp13.phx.gbl...> I am building a poll control, nested in the tag I have child tags to setup
> the poll options.
>
> Everything works fine, but when I edit a property in VS design mode, VS
> removes the child tags.
>
>
>
> C# Code:
>
> [ParseChildren(true, "Options")]
> public class PollForm : Control, INamingContainer
> {
> private ArrayList options = new ArrayList();
>
> public ArrayList Options
> {
> get { return options; }
> }
> }
>
>
> public class Option
> {
> private string text;
>
> public string Text
> {
> get { return text; }
> set { text = value; }
> }
> }
>
> Tags:
>
> <MyTag:PollForm id="poll1" runat="server">
> <MyTag:Option Text="Option 1" />
> <MyTag:Option Text="Option 2" />
> </MyTag:PollForm>
>
>
> How do I stop VS removing the child tags?
Victor Garcia Aprea [MVP] Guest
-
Steve #3
Re: Using ParseChildren attribute to load child tags - VS removes tags
Thanks
this is what i finely got to work
adding [PersistenceMode(PersistenceMode.InnerProperty)] to the public
property
C# Code:
[ParseChildren(true, "Options")]
public class PollForm : Control, INamingContainer
{
private ArrayList options = new ArrayList();
[PersistenceMode(PersistenceMode.InnerProperty)]
public ArrayList Options
{
get { return options; }
}
}
public class Option
{
private string text;
public string Text
{
get { return text; }
set { text = value; }
}
}
Tags:
<MyTag:PollForm id=”poll1” runat="server">
<MyTag:Option Text=”Option 1” />
<MyTag:Option Text=”Option 2” />
</MyTag:PollForm>
Steve Guest



Reply With Quote

