本文整理匯總了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();
}