.NET: Need To Drop The Span Tag From the Label Control? Use the Literal Control Instead

Jul

27

by Mike Fleming at 8:15 am No Comments .NET | ,


Have you ever had the need to use a label control, but you don’t need the span tag that the control automatically wraps around the text? Switch your control over to the Literal control instead. It serves the same general purpose as the label control, but will not wrap your output in those pesky span tags.



You can then use your normal server side code to the change the value, just as you would the label control:


myControl.Text = "My new random value"


Categories .NET | Tags: ,

Leave a Reply or Return to Top