Literal Control

Literal Control

Previous Home Next

 

A Literal Web Server control doesn't have any visual appearance on a Web Form but is used to insert literal text into a Web Form. This control makes it possible to add HTML code directly in the code designer window without switching to design view and clicking the HTML button to edit the HTML. The class hierarchy for this control is as follows:

 Object
  Control
   Literal 
Property:
Text ::Specifies the text to display.

  
   

 

 Literal Control
***********************************************************************

 <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Literal.aspx.cs" Inherits="_Default" %>





    Literal Control


    
*********************************************************************** CS Code for Literal When Button Clicked *********************************************************************** using System; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { Literal1.Text = "

Welcome To You

"; } }
Previous Home Next