当前位置: 首页>>代码示例>>C#>>正文


C# HtmlTextWriter.WriteLineNoTabs方法代码示例

本文整理汇总了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>");
        }
开发者ID:Aliceljm1,项目名称:kiss-project.web,代码行数:43,代码来源:Head.cs

示例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>");
		}
开发者ID:rickyinnz,项目名称:n2cms,代码行数:44,代码来源:ControlPanel.cs

示例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));
            }
开发者ID:cipher4uall,项目名称:hop-attendance,代码行数:74,代码来源:Excelimport.cs

示例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>");
        }
开发者ID:spmason,项目名称:n2cms,代码行数:37,代码来源:ControlPanel.cs

示例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 ();
		}
开发者ID:nobled,项目名称:mono,代码行数:62,代码来源:HtmlTextWriterCas.cs


注:本文中的System.Web.UI.HtmlTextWriter.WriteLineNoTabs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。