Feb 03, 2010, 3:15 PM
[CLOSED] Label Html issue
I have some html that displays fine in the HTML editor and then I take that string and displaying tot he user in Label using Label1.Html = string. However, list such as <ul> and <ol> are not displayed properly in the Label.
here is sample page. do I have to include some styles for the label to work.
thanks
here is sample page. do I have to include some styles for the label to work.
thanks
<%@ Page Language="C#" %>
<%@ Register assembly="Coolite.Ext.Web" namespace="Coolite.Ext.Web" tagprefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_load(object sender, EventArgs e)
{
string s = "<ul><li>asdasd</li><li>adadas</li><li>asdasdsa</li></ul><br />Credit Incentive Program (CIP) Tracker<br /><br /><br />";
s += "<p align='left'>CO is committed to establishing a strategic partnership with our members to provide maximum protection, help control losses and positively impact the overall cost of property and liability and workers' compensation coverage through the Credit Incentive Program.&nbsp; </p>";
s += "<p align='left'>Credit incentives of up to 15 points (excluding bonus points) can be earned based on an Agency's participation in meeting the following program guidelines. One CIP point is equal to a 1% discount on the Agency's applicable net premium. Within each track, participating members may choose among various options to reach the maximum points allowable within that track. Please note the maximum total a member can receive is 15 points (excluding bonus points)</p>";
s += "<p align='left'>For P/L Program members, points earned after March 31, 2010 will be applied to the next program year.&nbsp; For Workers' Compensation Program members, points earned after June 30, 2010 will be applied to the next program year.</p>";
s += "<p align='left'>This program is provided through Online to allow you, the Member, to to perform two functions for CIP's earned during the current program Year:</p>";
s += "<ol>";
s += "<li><p align='left'>To view the Credits that have been recorded by CO for the current program year.&nbsp; (Activities that have grey check marks have been recorded as earned.)</p></li>";
s += "<li><p align='left'>To estimate total discount that will be applied in a &quot;what if&quot; scenario by selecting individual CIP Activities.&nbsp; (These are for estimating purposes only.&nbsp; All discounts will be accepted and verified <strong><em>only</em></strong> by CO)</p></li>";
s += "</ol>";
s += "<br /><br />";
s += "<p align='left'>For questions regarding point credits, please call CO Chief Risk Officer .<br />For information regarding the Credit Incentive Program, please call CO Claims Assistant .</p>";
lbl2.Html = Server.HtmlDecode(s);
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Label Control Variations - Coolite Toolkit Examples</title>
<link href="../../../../resources/css/examples.css" rel="stylesheet" type="text/css" />
<style type="text/css">
/*
ol
{
list-style-position: inside;
list-style-type: upper-roman !important ;
color: #999999 !important ;
}
ol p
{
padding-left:6px !important ;
font-family: Tahoma !important ;
font-size: 12px !important;
font-weight:bold !important;
color: #666666 !important ;
}
*/
</style>
</head>
<body>
<ext:ScriptManager ID="ScriptManager1" runat="server" />
<h1>Label Control Variations</h1>
<h2>1. Simple label</h2>
<ext:Label runat="server" Text="Label" />
<h2>2. Html label</h2>
<ext:Label runat="server" ID="lbl2" />
<h2>3. Label with icon</h2>
<ext:Label runat="server" Text="Label" Icon="Note" />
<h2>4. Label with right-align icon</h2>
<ext:Label ID="Label1" runat="server" Text="Label" Icon="Note" IconAlign="Right" />
</body>
</html>