Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 28, 2012 01:39 AM by Decker Dong - MSFT
Member
97 Points
46 Posts
Mar 26, 2012 09:30 PM|LINK
Hi, everyone.
I want my custom templated control to support inline code blocks. eg.
<mc:MyControl id="xxx" runat="server> <ItemTemplate> <div><%="Inline code goes here" %></div> </ItemTemplate> </mc:MyControl> How do I do it? Thank you in advance. P.S. I know about data binding and know that <%#SomePublicVariableDefinedOnAspxCS %> will work but I really need it to be <%=SomePublicVariableDefinedOnAspxCS %>
Mar 26, 2012 09:42 PM|LINK
Forget it.
It didn't work because I have a collection of ItemTempate and the collection "cannot be modified because the control contains code blocks"
Being stupid is not easy
All-Star
118619 Points
18779 Posts
Mar 28, 2012 01:39 AM|LINK
never_again Forget it. It didn't work because I have a collection of ItemTempate and the collection "cannot be modified because the control contains code blocks" Being stupid is not easy
Congratulations that you've solved your problem,welcome to our forum next time to share your nice solution or chat with us about ASP.NET……
Reguards!
never_again
Member
97 Points
46 Posts
Inline code in templated controls
Mar 26, 2012 09:30 PM|LINK
Hi, everyone.
I want my custom templated control to support inline code blocks. eg.
<mc:MyControl id="xxx" runat="server>
<ItemTemplate>
<div><%="Inline code goes here" %></div>
</ItemTemplate>
</mc:MyControl>
How do I do it?
Thank you in advance.
P.S. I know about data binding and know that <%#SomePublicVariableDefinedOnAspxCS %> will work
but I really need it to be <%=SomePublicVariableDefinedOnAspxCS %>
never_again
Member
97 Points
46 Posts
Re: Inline code in templated controls
Mar 26, 2012 09:42 PM|LINK
Forget it.
It didn't work because I have a collection of ItemTempate and the collection "cannot be modified because the control contains code blocks"
Being stupid is not easy
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Inline code in templated controls
Mar 28, 2012 01:39 AM|LINK
Congratulations that you've solved your problem,welcome to our forum next time to share your nice solution or chat with us about ASP.NET……
Reguards!