本文整理汇总了C#中System.Web.UI.HtmlTextWriter.A方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlTextWriter.A方法的具体用法?C# HtmlTextWriter.A怎么用?C# HtmlTextWriter.A使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.HtmlTextWriter
的用法示例。
在下文中一共展示了HtmlTextWriter.A方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderTextBox
private void RenderTextBox(HtmlTextWriter writer, string name, string value, string watermark, params string[] icons)
{
writer.AddStyleAttribute(HtmlTextWriterStyle.PaddingRight, "2px");
writer.RenderBeginTag(HtmlTextWriterTag.Td);
writer.AddStyleAttribute(HtmlTextWriterStyle.Position, "relative");
writer.AddStyleAttribute(HtmlTextWriterStyle.PaddingRight, (16 * icons.Length) + "px");
AddressTextBoxStyle.AddAttributesToRender(writer);
writer.RenderBeginTag(HtmlTextWriterTag.Div);
var textBoxStyle = new BorderedPanelStyle();
textBoxStyle.Font.MergeWith(AddressTextBoxStyle.Font);
writer.AddAttribute(HtmlTextWriterAttribute.Id, _fileView.ClientID + name);
writer.AddAttribute(HtmlTextWriterAttribute.Value, value, true);
writer.AddStyleAttribute(HtmlTextWriterStyle.BorderWidth, "0");
writer.AddStyleAttribute(HtmlTextWriterStyle.Padding, "0");
writer.AddStyleAttribute(HtmlTextWriterStyle.Margin, "0");
writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
textBoxStyle.AddAttributesToRender(writer);
writer.AddStyleAttribute(HtmlTextWriterStyle.Position, "relative");
writer.AddStyleAttribute(HtmlTextWriterStyle.ZIndex, "2");
writer.AddStyleAttribute(HtmlTextWriterStyle.BackgroundColor, "transparent");
writer.RenderBeginTag(HtmlTextWriterTag.Input);
writer.RenderEndTag();
for (var i = 0; i < icons.Length; i++)
{
var icon = icons[i];
var i1 = i;
writer
.A(x => x.Id(_fileView.ClientID + name + i1).Width(16).Height(16).Href("javascript:;").Display("none").Position("absolute").Right(16 * i1).Bottom(AddressTextBoxStyle.PaddingBottom))
.Img(x => x.Border(0).Src(icon))
.EndTag()
.EndTag();
}
if (!String.IsNullOrEmpty(watermark))
{
writer
.Span(x => x.Id(_fileView.ClientID + name + "Watermark").Position("absolute").ZIndex(1).Top(AddressTextBoxStyle.PaddingTop).Left(AddressTextBoxStyle.PaddingLeft).Color(AddressTextBoxStyle.BorderColor).Italic().Cursor("text"))
.Text(watermark)
.EndTag();
}
writer.RenderEndTag(); // div
writer.RenderEndTag(); // td
}