November Happy Hour will be moved to Thursday December 5th.

property String (<= 255) question

Vote:
 

Hi

When I added a String(<=255) property, in there out put html code, there is a <span> </span> added with the value, how to or is it possible to removed the span tag?

 G'day

#27929
Feb 13, 2009 13:19
Vote:
 
<%= CurrentPage.Property["PropertyName"].Value %>
#27930
Feb 13, 2009 13:38
Vote:
 

Hi Homer.

If you want to use the <EPiServer:Property> webcontrol, take a look at these blog posts:

http://labs.episerver.com/en/Blogs/Steve-Celius/Dates/112266/2/Taking-Control-of-Property-Rendering/ 

http://labs.episerver.com/en/Blogs/Mari-Jorgensen/Dates/112298/3/Replacing-Property-Rendering-Using-Adapters/ 

Br, Tore

#27931
Feb 13, 2009 13:45
Vote:
 
Thx guys :)
#27940
Feb 13, 2009 14:50
Vote:
 

Be carful with the code below that can break your page: 

<%= CurrentPage.Property["PropertyName"] %>

You should always take care to add html encoding:

<%= HttpUtility.HtmlEncode(CurrentPage.Property["PropertyName"] as string) %>

Read more: http://blog.fredrikhaglund.se/blog/2008/12/08/epipattern-how-to-render-valid-xhtml-part-12/

 

#27964
Feb 15, 2009 15:00
Vote:
 

Fredrik, u r so cool :) Still teaching CMS5 beginners course these days?

Thx for ur comments!!!

#28052
Feb 18, 2009 14:42
Vote:
 
Yes, still teaching... and still listening to Schlager ;-)
#28073
Feb 18, 2009 19:26
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.