You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace System.Web.UI.WebControls {
|
||||
// Used in the login controls for accessibility
|
||||
internal sealed class LabelLiteral : Literal {
|
||||
internal Control _for;
|
||||
internal bool _renderAsLabel = false;
|
||||
|
||||
internal LabelLiteral(Control forControl) {
|
||||
_for = forControl;
|
||||
}
|
||||
|
||||
internal bool RenderAsLabel {
|
||||
get {
|
||||
return _renderAsLabel;
|
||||
}
|
||||
set {
|
||||
_renderAsLabel = value;
|
||||
}
|
||||
}
|
||||
|
||||
protected internal override void Render(HtmlTextWriter writer) {
|
||||
// Render as a label in designer for accessibility
|
||||
if (RenderAsLabel) {
|
||||
// Total hack for accessibility of labels for login controls!
|
||||
writer.Write("<asp:label runat=\"server\" AssociatedControlID=\"");
|
||||
writer.Write(_for.ID);
|
||||
writer.Write("\" ID=\"");
|
||||
writer.Write(_for.ID);
|
||||
writer.Write("Label\">");
|
||||
writer.Write(Text);
|
||||
writer.Write("</asp:label>");
|
||||
}
|
||||
else {
|
||||
writer.AddAttribute(HtmlTextWriterAttribute.For, _for.ClientID);
|
||||
writer.RenderBeginTag(HtmlTextWriterTag.Label);
|
||||
base.Render(writer);
|
||||
writer.RenderEndTag();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user