本文整理汇总了C#中System.Web.UI.WebControls.TableItemStyle.AddAttributesToRender方法的典型用法代码示例。如果您正苦于以下问题:C# TableItemStyle.AddAttributesToRender方法的具体用法?C# TableItemStyle.AddAttributesToRender怎么用?C# TableItemStyle.AddAttributesToRender使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.TableItemStyle
的用法示例。
在下文中一共展示了TableItemStyle.AddAttributesToRender方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderCalendarHeaderCell
private void RenderCalendarHeaderCell(HtmlTextWriter writer, TableItemStyle style, string text, string abbrText)
{
style.AddAttributesToRender(writer, this);
writer.AddAttribute("abbr", abbrText);
writer.AddAttribute("scope", "col");
writer.RenderBeginTag(HtmlTextWriterTag.Th);
writer.Write(text);
writer.RenderEndTag();
}
示例2: AddAttributesToRender_Null_WebControl
public void AddAttributesToRender_Null_WebControl ()
{
TableItemStyle tis = new TableItemStyle ();
tis.AddAttributesToRender (null, new TableRow ());
// no exception
}
示例3: RenderCalendarCell
private void RenderCalendarCell(HtmlTextWriter writer, TableItemStyle style, string text, string title, bool hasButton, string eventArgument)
{
style.AddAttributesToRender(writer, this);
writer.RenderBeginTag(HtmlTextWriterTag.Td);
if (hasButton)
{
Color foreColor = style.ForeColor;
writer.Write("<a href=\"");
writer.Write(this.Page.ClientScript.GetPostBackClientHyperlink(this, eventArgument, true));
writer.Write("\" style=\"color:");
writer.Write(foreColor.IsEmpty ? this.defaultButtonColorText : ColorTranslator.ToHtml(foreColor));
if (!string.IsNullOrEmpty(title))
{
writer.Write("\" title=\"");
writer.Write(title);
}
writer.Write("\">");
writer.Write(text);
writer.Write("</a>");
}
else
{
writer.Write(text);
}
writer.RenderEndTag();
}
示例4: RenderCalendarCell
private void RenderCalendarCell(HtmlTextWriter writer, TableItemStyle style, string text, string title, bool hasButton, string eventArgument) {
style.AddAttributesToRender(writer, this);
writer.RenderBeginTag(HtmlTextWriterTag.Td);
if (hasButton) {
// render the button
Color foreColor = style.ForeColor;
writer.Write("<a href=\"");
writer.Write(Page.ClientScript.GetPostBackClientHyperlink(this, eventArgument, true));
// ForeColor needs to go on the actual link. This breaks the uplevel/downlevel rules a little bit,
// but it is worth doing so the day links do not change color when they go in the history on
// downlevel browsers. Otherwise, people get it confused with the selection mechanism.
writer.Write("\" style=\"color:");
writer.Write(foreColor.IsEmpty ? defaultButtonColorText : ColorTranslator.ToHtml(foreColor));
if (!String.IsNullOrEmpty(title)) {
writer.Write("\" title=\"");
writer.Write(title);
}
writer.Write("\">");
writer.Write(text);
writer.Write("</a>");
}
else {
writer.Write(text);
}
writer.RenderEndTag();
}