CLabel: Custom label with tag parameter.
This commit is contained in:
45
Scrummer/Code/Controls/CLabel.cs
Normal file
45
Scrummer/Code/Controls/CLabel.cs
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
|
||||||
|
namespace Scrummer.Code.Controls
|
||||||
|
{
|
||||||
|
public class CLabel : Label
|
||||||
|
{
|
||||||
|
#region Declarations
|
||||||
|
|
||||||
|
private string _tagName = "span";
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Properties
|
||||||
|
|
||||||
|
public string Tag
|
||||||
|
{
|
||||||
|
get { return _tagName; }
|
||||||
|
set { _tagName = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Life cycle
|
||||||
|
|
||||||
|
public override void RenderBeginTag(HtmlTextWriter writer)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(_tagName) == false)
|
||||||
|
{
|
||||||
|
this.AddAttributesToRender(writer);
|
||||||
|
writer.RenderBeginTag(_tagName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
base.RenderBeginTag(writer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -71,6 +71,7 @@
|
|||||||
<Content Include="Web.config" />
|
<Content Include="Web.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="Code\Controls\CLabel.cs" />
|
||||||
<Compile Include="Code\JSON\ParserContext.cs" />
|
<Compile Include="Code\JSON\ParserContext.cs" />
|
||||||
<Compile Include="GlobalRouter.cs" />
|
<Compile Include="GlobalRouter.cs" />
|
||||||
<Compile Include="Code\JSON\JSONParser.cs" />
|
<Compile Include="Code\JSON\JSONParser.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user