本文整理汇总了C#中System.Web.UI.HtmlTextWriter.WriteLineNoTabs方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlTextWriter.WriteLineNoTabs方法的具体用法?C# HtmlTextWriter.WriteLineNoTabs怎么用?C# HtmlTextWriter.WriteLineNoTabs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.HtmlTextWriter
的用法示例。
在下文中一共展示了HtmlTextWriter.WriteLineNoTabs方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderHtml
private void RenderHtml(HtmlTextWriter writer)
{
writer.WriteLine("<head data-vp='{0}' data-vp2='{1}'>",
StringUtil.CombinUrl(Context.Request.ApplicationPath, "/"),
JContext.Current.url("/"));
writer.WriteLine("<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />");
writer.WriteLine("<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">");
RenderTitle(CurrentSite, writer);
writer.WriteLineNoTabs(string.Format(@"<meta name=""generator"" content=""KISS Projects v{0}"" />", Assembly.GetExecutingAssembly().GetName().Version.ToString()));
base.Render(writer);
RenderMetaTags(writer);
RenderLinkTags(writer);
RenderStyleSheets(writer);
RenderFavicon(writer);
RenderAutoDiscoverySyndication(writer);
RenderAdditionHeader(writer);
RenderRawContent(writer);
// 输出对jquery的引用
if (RequireJquery)
{
string jquery_definition = CurrentSite["define_jquery.js"];
if (string.IsNullOrEmpty(jquery_definition))
{
writer.Write("<script src='{0}' type='text/javascript'></script>", Resources.Utility.GetResourceUrl(GetType(), "Kiss.Web.jQuery.jquery.js", true));
}
else
{
writer.Write("<script src='{0}' type='text/javascript'></script>", JContext.Current.CombinUrl(CurrentSite, jquery_definition, false));
}
}
writer.Write("</head>");
}
示例2: Render
protected override void Render(HtmlTextWriter writer)
{
IDictionary<string, IList<string>> arrays = GetArrays(Page);
writer.WriteLineNoTabs(@"<script type='text/javascript'>//<!--");
if (arrays.Count > 0)
{
foreach (var pair in arrays)
{
IList<string> array = pair.Value;
writer.Write("var " + pair.Key + " = [" + array[0]);
for (int i = 1; i < array.Count; i++)
{
writer.Write("," + array[i]);
}
writer.WriteLineNoTabs("];");
}
}
if (EnableEditInterfaceIntegration)
{
writer.WriteLineNoTabs("if(window.n2ctx){");
writer.WriteLineNoTabs("n2ctx.select('preview');");
if (CurrentItem != null)
{
var adapter = Engine.GetContentAdapter<NodeAdapter>(CurrentItem);
string navigationUrl = Engine.ManagementPaths.GetNavigationUrl(CurrentItem);
string previewUrl = adapter.GetPreviewUrl(CurrentItem);
string script = string.Format(switchScriptFormat,
CurrentItem.Path, // 0
previewUrl, // 1
navigationUrl, // 2
adapter.GetMaximumPermission(CurrentItem), // 3
(Page.Request["refresh"] == "true").ToString().ToLower(), // 4
GetState(Page.GetEngine()).ToString());
writer.WriteLineNoTabs(script);
}
writer.WriteLineNoTabs("}");
}
writer.Write(@"//--></script>");
writer.Write("<div class='controlPanel state" + CurrentItem.State.ToString() + "'>");
base.Render(writer);
writer.Write("</div>");
}
示例3: WriteFile
protected override void WriteFile(HttpResponseBase response)
{
// Create HtmlTextWriter
StringWriter sw = new StringWriter();
HtmlTextWriter tw = new HtmlTextWriter(sw);
// Build HTML Table from Items
if (tableStyle != null)
tableStyle.AddAttributesToRender(tw);
tw.RenderBeginTag(HtmlTextWriterTag.Table);
// Create Title Row
tw.RenderBeginTag(HtmlTextWriterTag.Tr);
tw.AddAttribute(HtmlTextWriterAttribute.Colspan, (dt.Columns.Count - 2).ToString());
tw.RenderBeginTag(HtmlTextWriterTag.Td);
tw.Write(Title);
tw.RenderEndTag();
tw.AddAttribute(HtmlTextWriterAttribute.Colspan, "2");
tw.RenderBeginTag(HtmlTextWriterTag.Td);
if (TitleExportDate != string.Empty)
tw.WriteLineNoTabs(string.Format(TitleExportDate, DateTime.Now.ToString("dd.MM.yyyy")));
tw.RenderEndTag();
// Create Header Row
tw.RenderBeginTag(HtmlTextWriterTag.Tr);
DataColumn col = null;
for (Int32 i = 0; i <= dt.Columns.Count - 1; i++)
{
col = dt.Columns[i];
if (headerStyle != null)
headerStyle.AddAttributesToRender(tw);
tw.RenderBeginTag(HtmlTextWriterTag.Th);
tw.RenderBeginTag(HtmlTextWriterTag.Strong);
tw.WriteLineNoTabs(col.ColumnName);
tw.RenderEndTag();
tw.RenderEndTag();
}
tw.RenderEndTag();
// Create Data Rows
foreach (DataRow row in dt.Rows)
{
tw.RenderBeginTag(HtmlTextWriterTag.Tr);
for (Int32 i = 0; i <= dt.Columns.Count - 1; i++)
{
if (itemStyle != null)
itemStyle.AddAttributesToRender(tw);
tw.RenderBeginTag(HtmlTextWriterTag.Td);
tw.WriteLineNoTabs(HttpUtility.HtmlEncode(row[i]));
tw.RenderEndTag();
}
tw.RenderEndTag(); // /tr
}
tw.RenderEndTag(); // /table
///<summary>
///The Footer Parts of the Excel Reports
///<!summary>
tw.RenderBeginTag(HtmlTextWriterTag.Tr);
tw.AddAttribute(HtmlTextWriterAttribute.Colspan, (dt.Columns.Count - 2).ToString());
tw.RenderBeginTag(HtmlTextWriterTag.Td);
//tw.WriteLineNoTabs(Footer);
tw.RenderEndTag();
tw.AddAttribute(HtmlTextWriterAttribute.Colspan, "2");
tw.RenderBeginTag(HtmlTextWriterTag.Td);
if (TitleExportDate != string.Empty)
tw.WriteLineNoTabs(Footer);
tw.RenderEndTag();
// Write result to output-stream
Stream outputStream = response.OutputStream;
byte[] byteArray = Encoding.Default.GetBytes(sw.ToString());
response.OutputStream.Write(byteArray, 0, byteArray.GetLength(0));
}
示例4: Render
protected override void Render(HtmlTextWriter writer)
{
IDictionary<string, IList<string>> arrays = GetArrays(Page);
writer.WriteLineNoTabs(@"<script type='text/javascript'>//<!--");
if (arrays.Count > 0)
{
foreach (var pair in arrays)
{
IList<string> array = pair.Value;
writer.Write("var " + pair.Key + " = [" + array[0]);
for (int i = 1; i < array.Count; i++)
{
writer.Write("," + array[i]);
}
writer.WriteLineNoTabs("];");
}
}
if (EnableEditInterfaceIntegration)
{
writer.WriteLineNoTabs("if(n2ctx){");
writer.WriteLineNoTabs("n2ctx.select('preview');");
if (CurrentItem != null)
{
string navigationUrl = Engine.ManagementPaths.GetNavigationUrl(CurrentItem);
string previewUrl = Engine.GetContentAdapter<NodeAdapter>(CurrentItem).GetPreviewUrl(CurrentItem);
string script = string.Format(switchScriptFormat, CurrentItem.Path, previewUrl, navigationUrl);
writer.WriteLineNoTabs(script);
}
writer.WriteLineNoTabs("}");
}
writer.Write(@"//--></script>");
writer.Write("<div class='controlPanel'>");
base.Render(writer);
writer.Write("</div>");
}
示例5: Deny_Unrestricted
private void Deny_Unrestricted (HtmlTextWriter htw)
{
Assert.IsTrue (htw.Indent >= 0, "Indent");
Assert.AreSame (sw, htw.InnerWriter, "InnerWriter");
htw.NewLine = Environment.NewLine;
Assert.IsNotNull (htw.NewLine, "NewLine");
htw.AddAttribute (HtmlTextWriterAttribute.Bgcolor, "blue");
htw.AddAttribute (HtmlTextWriterAttribute.Bgcolor, "blue", false);
htw.AddAttribute ("align", "left");
htw.AddAttribute ("align", "left", false);
htw.AddStyleAttribute (HtmlTextWriterStyle.BackgroundColor, "blue");
htw.AddStyleAttribute ("left", "1");
htw.RenderBeginTag (HtmlTextWriterTag.Table);
htw.RenderBeginTag ("<tr>");
htw.RenderEndTag ();
htw.WriteAttribute ("align", "left");
htw.WriteAttribute ("align", "left", false);
htw.WriteBeginTag ("table");
htw.WriteEndTag ("table");
htw.WriteFullBeginTag ("div");
htw.WriteStyleAttribute ("left", "2");
htw.WriteStyleAttribute ("left", "3", false);
htw.Write (new char[1], 0, 1);
htw.Write ((double)1.0);
htw.Write (Char.MinValue);
htw.Write (new char[1]);
htw.Write ((int)1);
htw.Write ("{0}", 1);
htw.Write ("{0}{1}", 1, 2);
htw.Write ("{0}{1}{2}", 1, 2, 3);
htw.Write (String.Empty);
htw.Write ((long)1);
htw.Write (this);
htw.Write ((float)1.0);
htw.Write (false);
htw.WriteLine (new char[1], 0, 1);
htw.WriteLine ((double)1.0);
htw.WriteLine (Char.MinValue);
htw.WriteLine (new char[1]);
htw.WriteLine ((int)1);
htw.WriteLine ("{0}", 1);
htw.WriteLine ("{0}{1}", 1, 2);
htw.WriteLine ("{0}{1}{2}", 1, 2, 3);
htw.WriteLine (String.Empty);
htw.WriteLine ((long)1);
htw.WriteLine (this);
htw.WriteLine ((float)1.0);
htw.WriteLine (false);
htw.WriteLine ((uint)0);
htw.WriteLine ();
htw.WriteLineNoTabs (String.Empty);
htw.Flush ();
htw.Close ();
}