本文整理汇总了C#中System.Web.UI.HtmlTextWriter.WriteLine方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlTextWriter.WriteLine方法的具体用法?C# HtmlTextWriter.WriteLine怎么用?C# HtmlTextWriter.WriteLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.HtmlTextWriter
的用法示例。
在下文中一共展示了HtmlTextWriter.WriteLine方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
protected override void Render(HtmlTextWriter writer)
{
CreateChildControls();
string styleString = "";
foreach (string key in Style.Keys)
{
styleString += key + ":" + Style[key] + ";";
}
writer.WriteLine("<div class=\"propertypane\" style='" + styleString + "'>");
writer.WriteLine("<div>");
try
{
RenderChildren(writer);
}
catch (Exception ex)
{
writer.WriteLine("Error creating control <br />");
writer.WriteLine(ex.ToString());
}
writer.WriteLine("</div>");
writer.WriteLine("</div>");
}
示例2: renderTitle
public override void renderTitle(HtmlTextWriter writer)
{
//escrever ttulo
writer.WriteLine("<div align='center' class='planetInfoZoneTitle'><b>");
writer.WriteLine( info.getContent("scan_planetTitle"), _sector );
writer.WriteLine("</b></div>");
}
示例3: RenderApple
private void RenderApple(HtmlTextWriter writer)
{
writer.WriteLine("<div>Requires Quicktime and a Html 5 browser such as Firefox 10+ or IE 9+</div>");
writer.WriteLine("<object data='" + Url + "' width='" + Width +"' height='" + Height + "'><embed src='" + Url + "' width='"+Width+"' height='" + Height + "' /></object> ");
//writer.WriteLine("<EMBED SRC='"+ Url + "' WIDTH=" + Width+ " HEIGHT = '"+ Height +"' AUTOPLAY='false' CONTROLLER='true' LOOP=\"false\" PLUGINSPAGE=\"http://www.apple.com/quicktime/\">");
//writer.WriteLine("<video width='" + Width + "' height='" + Height + " autoplay=\"0\" controls=\"1\" tabindex=\"0\"><source type=\"video/mp4\" src='" + Url +"'></source></video>");
}
示例4: Render
protected override void Render(HtmlTextWriter output)
{
output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Cellpadding, "0");
output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Cellspacing, "0");
output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Id, this.ClientID);
output.AddAttribute("ig_mark", "");
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Table);
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Tr);
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Td);
output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Id, this.ClientID + "_inputbox");
/* VS 05/22/2013 Bug 142807 wrong height of input */
output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Class, "Fonts inputHeight1");
output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Tabindex, this.TabIndex.ToString());
if (this.Width != Unit.Empty)
output.AddStyleAttribute("width", this.Width.ToString());
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Input);
output.RenderEndTag(); // Input
output.RenderEndTag(); // Td
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Td);
/* VS 05/22/2013 Bug 142807 wrong size of button */
output.WriteLine("<BUTTON style='width: 15px; height: 20px; padding:0px;' onfocus='blur()' type='button' ID='" + this.ClientID + "_button'>");
output.Write("<img src = './Images/downarrow.gif'>");
output.WriteLine("</BUTTON>");
output.RenderEndTag(); // TD
output.RenderEndTag(); // Tr
output.RenderEndTag(); // Table
}
示例5: Render
protected override void Render(HtmlTextWriter writer)
{
base.Render(writer);
try
{
HttpBrowserCapabilities browserInfo = HttpContext.Current.Request.Browser;
int browserVersion = browserInfo.MajorVersion;
switch (Condition.ToLower())
{
case ("lte"):
if (browserVersion <= int.Parse(Threshold))
writer.WriteLine("<script src=\"" + Source + "\" type=\"text/javascript\">" + "<" + "/" + "script>");
break;
case ("gt"):
if (browserVersion > int.Parse(Threshold))
writer.WriteLine("<script src=\"" + Source + "\" type=\"text/javascript\">" + "<" + "/" + "script>");
break;
case ("gte"):
if (browserVersion >= int.Parse(Threshold))
writer.WriteLine("<script src=\"" + Source + "\" type=\"text/javascript\">" + "<" + "/" + "script>");
break;
default:
if (browserVersion < int.Parse(Threshold))
writer.WriteLine("<script src=\"" + Source + "\" type=\"text/javascript\">" + "<" + "/" + "script>");
break;
}
}
catch { }
}
示例6: BuildItem
private void BuildItem(System.Web.UI.WebControls.TreeNode item, HtmlTextWriter writer)
{
TreeView treeView = this;
if ((treeView != null) && (item != null) && (writer != null))
{
writer.WriteLine();
writer.WriteBeginTag("li");
if (item.Selected || IsChildNodeSelected(item.ChildNodes))
writer.WriteAttribute("class", "open");
writer.Write(HtmlTextWriter.TagRightChar);
writer.Indent++;
writer.WriteLine();
if (!string.IsNullOrEmpty(item.NavigateUrl))
{
WriteNodeLink(treeView, item, writer);
}
else
{
WriteNodePlain(treeView, item, writer);
}
if (HasChildren(item))
{
BuildItems(item.ChildNodes, false, item.Expanded.Equals(true), writer);
}
writer.Indent--;
writer.WriteLine();
writer.WriteEndTag("li");
}
}
示例7: RenderHelp
/// <summary>Mostra links de ajuda</summary>
private void RenderHelp( HtmlTextWriter writer )
{
writer.WriteLine("<ul class='help_zone'>");
writer.WriteLine("<li><a href='{0}'>{1}</a></li>", Wiki.GetUrl("Pr�mios"), info.getContent("wiki_Prizes"));
writer.WriteLine("<li><a href='{0}'>{1}</a></li>", Wiki.GetUrl("Medalhas"), info.getContent("wiki_Medals"));
writer.WriteLine("</ul>");
}
示例8: Render
/// <summary>Pinta o controlo</summary>
protected override void Render( HtmlTextWriter writer )
{
Planet previous = null;
Planet next = null;
int idx = Player.getIndex(Current);
previous = getPrevious(idx);
next = getNext(idx);
writer.WriteLine("<table width='100%' class='nav'>");
writer.WriteLine("<tr>");
writer.WriteLine("<td align='left' width='33%'>");
if( next != null ) {
writer.WriteLine("<a href='{0}?id={1}' title='{2} @ {3}'><<</a>", OrionGlobals.getSectionBaseUrl(Section), next.Id, next.Name, next.Coordinate.ToString() );
}
writer.WriteLine("</td>");
writer.WriteLine("<td align='center' width='33%'>");
writer.WriteLine("<b>{0}</b> @ {1}", Current.Name, Current.Coordinate.ToString());
writer.WriteLine("</td>");
writer.WriteLine("<td align='right' width='33%'>");
if( previous != null ) {
writer.WriteLine("<a href='{0}?id={1}' title='{2} @ {3}'>>></a>", OrionGlobals.getSectionBaseUrl(Section), previous.Id, previous.Name, previous.Coordinate.ToString() );
}
writer.WriteLine("</td>");
writer.WriteLine("</tr>");
writer.WriteLine("</table>");
if( Current.IsInBattle ) {
writer.WriteLine("<div class='errorTitle'>{0}</div>", info.getContent("PlanetInBattle"));
}
}
示例9: RenderEndTag
protected override void RenderEndTag(HtmlTextWriter writer) {
foreach(string script in this.ScriptBlocks.Values) {
writer.WriteLine(script);
writer.WriteLine();
}
base.RenderEndTag(writer);
}
示例10: Render
protected override void Render(HtmlTextWriter writer)
{
if (!NotRenderStyles)
{
var top_string = "<div class='" +
(String.IsNullOrEmpty(CssIdClassName)
? Settings.Default.DefaultCssIdClass
: CssIdClassName) +
"'>{TOP}<div class='bl'><div class='br ContentHolder'><div class='PanelRounded bd' rounded='true'>";
var bottom_string = "</div><div style='clear: both;'></div></div></div>{BOTTOM}</div>";
var top = DiscardTop
? String.Empty
: "<div class='hd'><div class='tl'></div><div class='tr'></div><div class='tc'></div><div style='clear: both;'></div></div>";
var bottom = DiscardBottom
? String.Empty
: "<div class='ft'><div class='fl'></div><div class='fr'></div><div class='fc'></div><div style='clear: both;'></div></div>";
top_string = top_string.Replace("{TOP}", top);
bottom_string = bottom_string.Replace("{BOTTOM}", bottom);
writer.WriteLine(top_string);
base.Render(writer);
writer.WriteLine(bottom_string);
}
else
{
base.Render(writer);
}
}
示例11: RenderArrayDeclares
public void RenderArrayDeclares(HtmlTextWriter writer)
{
if (_this._registeredArrayDeclares == null || _this._registeredArrayDeclares.Count == 0)
return;
writer.Write(ScriptStartTag);
foreach (DictionaryEntry entry in _this._registeredArrayDeclares) {
var key = (String)entry.Key;
var values = (ArrayList)entry.Value;
if (!_renderedArrayDeclares.ContainsKey(key)) {
var renderedValues = values.Cast<Object>()
.Select(obj => obj.ToString())
.ToList();
_renderedArrayDeclares[key] = renderedValues;
writer.WriteLine("var {0} = new Array({1});", key, String.Join(", ", renderedValues));
} else {
foreach (var value in values) {
var renderedValue = value.ToString();
if (!_renderedArrayDeclares[key].Contains(renderedValue)) {
writer.WriteLine("{0}.push({1});", key, renderedValue);
}
}
}
}
writer.Write(ScriptEndTag);
_this._registeredArrayDeclares = null;
}
示例12: WriteFooter
public static void WriteFooter(HtmlTextWriter wrtr, Type type,
bool autoDocVersion)
{
wrtr.WriteBeginTag("div");
wrtr.WriteAttribute("id", "content");
wrtr.Write(HtmlTextWriter.TagRightChar);
wrtr.WriteLine();
wrtr.WriteFullBeginTag("h2");
wrtr.Write(" ");
wrtr.WriteEndTag("h2");
wrtr.WriteLine();
if (autoDocVersion)
{
AssemblyName name1 = type.Assembly.GetName();
wrtr.Write("{0} {1}.{2}.{3} ", name1.Name,
name1.Version.Major, name1.Version.Minor, name1.Version.Build);
AssemblyName name2 = typeof(XmlRpcServerProtocol).Assembly.GetName();
wrtr.Write("{0} {1}.{2}.{3} ", name2.Name,
name2.Version.Major, name2.Version.Minor, name2.Version.Build);
wrtr.Write(".NET CLR {0}.{1}.{2} ",
Environment.Version.Major,Environment.Version.Minor,
Environment.Version.Build);
}
wrtr.WriteEndTag("div");
wrtr.WriteLine();
}
示例13: BuildItems
private void BuildItems(TreeNodeCollection items, bool isRoot, bool isExpanded, HtmlTextWriter writer)
{
if (items.Count > 0)
{
writer.WriteLine();
writer.WriteBeginTag("ul");
if (isRoot)
{
writer.WriteAttribute("id", this.ClientID);
}
writer.Write(HtmlTextWriter.TagRightChar);
writer.Indent++;
foreach (System.Web.UI.WebControls.TreeNode item in items)
{
BuildItem(item, writer);
}
writer.Indent--;
writer.WriteLine();
writer.WriteEndTag("ul");
}
}
示例14: Render
protected override void Render(HtmlTextWriter writer)
{
if (_comment.IsSpam)
_comment.CommentX = "<em>[comment removed]</em>";
string alternativeCssClass = "";
if (_useAlternativeStyle)
alternativeCssClass = "CommentAlt";
writer.WriteLine(@"<a name=""Comment_{0}""></a><div class=""Comment {0}"">", _comment.CommentID, alternativeCssClass);
//when displaying user comments
//need to show which story they commented on
if (_displayStoryTitle)
{
//build local URL to story
Category category = CategoryCache.GetCategory(_comment.Story.CategoryID, KickPage.HostProfile.HostID);
string categoryIdentifier = category.CategoryIdentifier;
string kickStoryUrl = UrlFactory.CreateUrl(UrlFactory.PageName.ViewStory, _comment.Story.StoryIdentifier, categoryIdentifier);
//story title
writer.Write(@"<div class=""storyTitle""><a href=""{0}#Comment_{1}"">{2}</a></div><br />",
kickStoryUrl, _comment.CommentID, _comment.Story.Title);
}
writer.WriteLine(@"<div class=""CommentText"">{0}</div>
<div class=""CommentAuthor"">posted by ", KickPage.KickUserProfile.ShowEmoticons ? TextHelper.ReplaceEmoticons(_comment.CommentX, KickPage.StaticEmoticonsRootUrl) : _comment.CommentX);
UserLink userLink = new UserLink();
userLink.DataBind(UserCache.GetUser(_comment.UserID));
userLink.RenderControl(writer);
writer.WriteLine(@" {0}</div></div>", Dates.ReadableDiff(_comment.CreatedOn, DateTime.Now));
}
示例15: RenderHeader
public override void RenderHeader(HtmlTextWriter writer)
{
string spacer = "<img src='" + Page.ResolveClientUrl(Panel.ImagesDir + "spacer.gif") + "'/>";
writer.WriteLine("");
writer.Write("<table cellpadding='" + CellPadding + "' cellspacing='" + CellSpacing + "'");
StringBuilder style = new StringBuilder();
if (!Width.IsEmpty)
{
style.Append("width:" + Width + ";");
}
if (style.Length > 0)
{
writer.Write(" style='" + style + "'");
}
writer.WriteLine(">");
writer.WriteLine(" <tr>");
writer.WriteLine(" <td class='panel_grey_ul'>" + spacer + "</td>");
writer.WriteLine(" <td class='panel_grey_u'>" + spacer + "</td>");
writer.WriteLine(" <td class='panel_grey_ur'>" + spacer + "</td>");
writer.WriteLine(" </tr>");
writer.WriteLine(" <tr>");
writer.WriteLine(" <td class='panel_grey_l'>" + spacer + "</td>");
writer.WriteLine(" <td class='panel_grey_c' align='" + InnerAlign + "'>");
}