• Home
  • Privacy Policy
  • Terms & Conditions
  • Contact
  • Advertise
Videos, Photos, Wallpapers, Free Download, Movies, Songs, Sports , Live TV, Entertainment
 
  • Home
  • Bollywood
  • Hollywood
  • Box Office
  • Beauty
  • Fashion
  • Celebrity
  • Business
    • Social Media
    • Money Online
    • Category
  • Entertainment
    • Bollywood
  • Video
    • Youtube
    • Video
  • Technology
    • Asp.net
    • C#
    • SQL
    • .Net
Showing posts with label Literal Control. Show all posts
The Literal control is similar to the Label control. You can use the Literal control to display text or HTML content in a browser. However, unlike the Label control, the Literal control does not render its content inside of a <span> tag.

<%@ Page Language=”C#” %>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<script runat=”server”>
void Page_Load()
{
ltlTitle.Text = DateTime.Now.ToString(“D”);
}
</script>
<html xmlns=”http://www.w3.org/1999/xhtml” >
<head>
<title><asp:Literal id=”ltlTitle” Runat=”Server” /></title>
</head>
<body>
<form id=”form1” runat=”server”>
<div>
<h1>Look in the title bar</h1>
</div>
</form>
</body>
</html>

Because the contents of a Literal control are not contained in a <span> tag, the Literal control does not support any of the formatting properties supported by the <span> tag.

For example, the Literal control does not support either the CssClass or BackColor properties.

The Literal control does support one property that is not supported by the Label control: the Mode property. The Mode property enables you to encode HTML content. The

Mode property accepts any of the following three values:
  • PassThrough : Displays the contents of the control without encoding.
  • Encode : Displays the contents of the control after HTML encoding the content.
  • Transform : Displays the contents of the control after stripping markup that is not supported by the requesting device.
Older Posts Home

ASP.NET Examples

 
2012 24x7 Magazine. All rights reserved.
Designed by 24x7 Magazine