What is a LiteralControl? I was reading about LiteralContols but I am not sure why they are used.
I used this code to list the controls in a page and -
I have
Try this:
foreach (Control control in Page.Controls)
{
Response.Write(control.GetType().ToString() + " - " + control.ID + "
");
if (control is LiteralControl)
{
Response.Write("Textt :" + ((LiteralControl)control).Text.ToString() + " - " +
Server.HtmlEncode(((LiteralControl)control).Text + "
") );
}
}