It took me a while to get warmed up to using it as well, mainly because there is no analogue on the Windows Forms side of things. Now that I am aware of it, I have been using it where appropriate.
J.Ja
Discussion on:
View:
Show:
I'm having problems with strings passed from the backend containing characters or tags that break in FireFox. I'm thinking using this controls mode property will help out alot. I'll continue to use labels but only for content that is static.
Thought???
Thought???
Yup, that's a good plan, it is what Literal is for. Basically says, "don't touch this!"
J.Ja
J.Ja
i've used it a few times, but I have to admit that the label control has been my main source for controling text display. only because my main use for the label control is to display error messages and instructions to the user.I will try to use more often now that I have seen some of the uses for it.
One main problem No Tooltip to display in literal control.
I feel guilty when I use it, because I more than not use it to allow more freedom to generate my own html output, because I don't know how to accomplish it using ASP .Net objects - it allows me to be a classic ASP developer inside .Net. I'm glad others approve of its use! I don't feel so bad now lol
I used the literal for a while, thinking the passthrough would work great but it didn't work the way I needed it to. But it's great for "cheating" as you say.
I switched to an xml control and wrote css to do what I needed for display purposes.
Then it boils down to this:
Me.xml_Display_Config_Settings_As_HTML.DocumentContent = sXML_as_HTML
Me.xml_Display_Config_Settings_As_HTML.TransformSource = "~/App_Themes/cfgDisplay.xsl"
Me.xml_Display_Config_Settings_As_HTML.DataBind()
ViewState.Add("xml_Display_Config_Settings_As_HTML", xml_Display_Config_Settings_As_HTML.DocumentContent)
I switched to an xml control and wrote css to do what I needed for display purposes.
Then it boils down to this:
Me.xml_Display_Config_Settings_As_HTML.DocumentContent = sXML_as_HTML
Me.xml_Display_Config_Settings_As_HTML.TransformSource = "~/App_Themes/cfgDisplay.xsl"
Me.xml_Display_Config_Settings_As_HTML.DataBind()
ViewState.Add("xml_Display_Config_Settings_As_HTML", xml_Display_Config_Settings_As_HTML.DocumentContent)
I like to use it like this:
alert('
This gives you the abstraction and flexibility of presenting errMessage to the user in the browser however you see fit, while setting its value in your code-behind file. This particular example uses a JavaScript alert box, but you could easily change that in the code-ahead page to something else, and wouldn't need to change the code-behind file.
alert('
This gives you the abstraction and flexibility of presenting errMessage to the user in the browser however you see fit, while setting its value in your code-behind file. This particular example uses a JavaScript alert box, but you could easily change that in the code-ahead page to something else, and wouldn't need to change the code-behind file.
Hi!
I want to programatically inject HTML in a literal control on an ASP.net page.
My literal lays inside an Ajax ModalPopup. All I want to do (following you example) is Assigned_ID.Text="<B>Boo</B>"
during btnTest_Click.
The problem is no matter what I try, AJAX seems to clean-up the HTML tags and the result is a simple Boo, not a bold one. Any thoughts?
Thank you,
Mircea.
I want to programatically inject HTML in a literal control on an ASP.net page.
My literal lays inside an Ajax ModalPopup. All I want to do (following you example) is Assigned_ID.Text="<B>Boo</B>"
during btnTest_Click.
The problem is no matter what I try, AJAX seems to clean-up the HTML tags and the result is a simple Boo, not a bold one. Any thoughts?
Thank you,
Mircea.
Trying to be useful, I leave this link:
Free video - Label and Literal Control - Course ASP. NET 4 and Visual Studio 2010
http://mrbool.com/p/-Label-and-Literal-Control-Course-ASP-NET-4-and-Visual-Studio-2010-Lesson-2/21022
Free video - Label and Literal Control - Course ASP. NET 4 and Visual Studio 2010
http://mrbool.com/p/-Label-and-Literal-Control-Course-ASP-NET-4-and-Visual-Studio-2010-Lesson-2/21022
- Keyboard Shortcuts:
- Prev
- Next
- Toggle

































