本文整理汇总了C#中HtmlTextWriter.Write方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlTextWriter.Write方法的具体用法?C# HtmlTextWriter.Write怎么用?C# HtmlTextWriter.Write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlTextWriter
的用法示例。
在下文中一共展示了HtmlTextWriter.Write方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
protected internal override void Render (HtmlTextWriter writer)
{
writer.RenderBeginTag (HtmlTextWriterTag.Title);
if (HasControls () || HasRenderMethodDelegate ())
RenderChildren (writer);
else
writer.Write (text);
writer.RenderEndTag ();
}
示例2: Render
protected override void Render(HtmlTextWriter writer)
{
if(Request.QueryString["action"] != null)
{
var start = Request.QueryString["start"];
var end = Request.QueryString["end"];
var filter = Request.QueryString["filter"];
var service = new CalendarService();
var json = service.GetDataAsJson(start, end, filter);
// Write the JSON
Response.Clear();
writer.Write(json);
Response.End();
// Write the JSON
Response.Clear();
writer.Write(json);
Response.End();
}
else
{
base.Render(writer);
}
}
示例3: DrawGridFooter
private void DrawGridFooter(HtmlTextWriter output, Control ctl)
{
int num = this.RadioSelete();
output.Write("<td width = '100px' height='50px'>");
output.Write("出现次数</td>");
output.Write("<td width = '100px'>");
output.Write(" </td>");
for (int i = 2; i < this.GridView1.Columns.Count; i++)
{
int num3 = 0;
for (int j = 0; j < this.GridView1.Rows.Count; j++)
{
if ((this.GridView1.Rows[j].Cells[i].Text == "0") || (this.GridView1.Rows[j].Cells[i].Text == "1"))
{
//num3 = num3;
this.num[i - 2] = num3;
this.sum[i - 2] = (num3 * 50) / num;
}
if ((((this.GridView1.Rows[j].Cells[i].Text == "2") || (this.GridView1.Rows[j].Cells[i].Text == "3")) || ((this.GridView1.Rows[j].Cells[i].Text == "4") || (this.GridView1.Rows[j].Cells[i].Text == "5"))) || ((this.GridView1.Rows[j].Cells[i].Text == "6") || (this.GridView1.Rows[j].Cells[i].Text == "7")))
{
num3++;
this.num[i - 2] = num3;
this.sum[i - 2] = (num3 * 50) / num;
}
}
output.Write("<td align='center' valign='bottom'>");
output.Write(this.num[i - 2].ToString() + "<br><img src='../image/01[1].gif' height='" + this.sum[i - 2].ToString() + "px' title = '" + this.num[i - 2].ToString() + "' width= '8px'></td>");
}
}
示例4: MoveViewState
//This is only used in the Render() overrides, which have been commented out.
protected void MoveViewState(HtmlTextWriter writer)
{
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
base.Render(hw);
string html = sw.ToString();
int ViewStateStart = html.IndexOf("<input type=\"hidden\" name=\"__VIEWSTATE\"");
if (ViewStateStart <= 0)
{
writer.Write(html);
return;
}
// write the section of html before viewstate
writer.Write(html.Substring(1, ViewStateStart - 1));
int ViewStateEnd = html.IndexOf("/>", ViewStateStart) + 2;
int FormEndStart = html.IndexOf("</form>");
// write the section after the viewstate and up to the end of the FORM
writer.Write(html.Substring(ViewStateEnd, html.Length - ViewStateEnd - (html.Length - FormEndStart)));
// write the viewstate itself
writer.Write(html.Substring(ViewStateStart, ViewStateEnd - ViewStateStart));
// now write the FORM footer
writer.Write(html.Substring(FormEndStart));
}
示例5: DrawGridFooter
protected void DrawGridFooter(HtmlTextWriter output, Control ctl)
{
output.Write("<td>出现次数</td>");
output.Write("<td> </td>");
for (int i = 0; i < 0x1c; i++)
{
output.Write("<td bgcolor='#F3F3F3'>");
output.Write(this.num[i].ToString() + "</td>");
}
}
示例6: RenderBr
void RenderBr (HtmlTextWriter w)
{
#if NET_2_0
w.Write ("<br />");
#else
// grrr, not xhtml...
w.Write ("<br>");
#endif
}
示例7: DrawGridFooter
protected void DrawGridFooter(HtmlTextWriter output, Control ctl)
{
for (int i = 1; i < 0x17; i++)
{
int index = i - 1;
this.num[index] = _Convert.StrToInt(this.GridView1.Rows[0].Cells[i].Text, 0);
int num3 = this.RadioSelete();
this.sum[index] = (this.num[index] * 150) / num3;
}
output.Write("<td bgcolor='#F7F7F7' height='140px' width='60px'><br><font color='#5A5A5A'>75%</font><br><br><font color='#5A5A5A'>50%</font><br><br><font color='#5A5A5A'>25%</font><br><br></td>");
for (int j = 0; j < 0x16; j++)
{
output.Write("<td align='center' valign='bottom' background='../Image/line[1].gif'>");
output.Write("<img src='../Image/01[1].gif' height='" + this.sum[j].ToString() + "'' title='" + this.num[j].ToString() + "' width='8px'></td>");
}
output.Write("<tr align='center'>");
output.Write("<td bgcolor='#F7F7F7'>号码</td>");
for (int k = 1; k < 10; k++)
{
output.Write("<td align='center' >");
output.Write(0 + k.ToString() + "</td>");
}
for (int m = 10; m < 0x17; m++)
{
output.Write("<td align='center'>");
output.Write(m.ToString() + "</td>");
}
}
示例8: DrawGridHeader
protected void DrawGridHeader(HtmlTextWriter output, Control ctl)
{
output.Write("<td rowspan='2' align='center' valign='middle'>期数</td>");
output.Write("<td rowspan='2' align='center' valign='middle'>开奖号码</td>");
output.Write("<td colspan='11'>除11余数</td>");
output.Write("<td colspan='9'>除9余数</td>");
output.Write("<td colspan='5'>除5余数</td>");
output.Write("<td colspan='3'>除3余数</td>");
output.Write("<tr align='center' valign='middle'>");
for (int i = 0; i < 11; i++)
{
output.Write("<td >");
output.Write(i.ToString() + "</td >");
}
for (int j = 0; j < 9; j++)
{
output.Write("<td bgcolor='#EDFFD7'>");
output.Write(j.ToString() + "</td>");
}
for (int k = 0; k < 5; k++)
{
output.Write("<td>");
output.Write(k.ToString() + "</td>");
}
for (int m = 0; m < 3; m++)
{
output.Write("<td bgcolor='#D2E1F0'>");
output.Write(m.ToString() + "</td>");
}
}
示例9: RenderSiteMapNode
private void RenderSiteMapNode(HtmlTextWriter writer, SiteMapPath path, SiteMapNode node)
{
writer.WriteBeginTag("a");
if(node.Url != "")
writer.WriteAttribute("href", node.Url);
if (node.Description != "")
writer.WriteAttribute("title", node.Description);
writer.Write(HtmlTextWriter.TagRightChar);
writer.Write(node.Title);
writer.WriteEndTag("a");
}
示例10: DrawGridFooter
protected void DrawGridFooter(HtmlTextWriter output, Control ctl)
{
output.Write("<td height='30' bgcolor='#f7f7f7'>预选行</td>");
for (int i = 1; i < 0x22; i++)
{
output.Write("<td onClick=Style(this,'../Images/red_" + i + ".gif') style='cursor:pointer' align='center' valign='center'> </td>");
}
for (int j = 1; j < 10; j++)
{
output.Write("<td> </td>");
}
}
示例11: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (Session["DownHtml"] == null)
{
Server.Transfer("~/Docentes/ListaEventos.aspx");
return;
}
dgEvento.DataSource = Session["DownHtml"] as DataTable;
dgEvento.DataBind();
MemoryStream ms = new MemoryStream();
StreamWriter sw = new StreamWriter(ms, Encoding.UTF8);
HtmlTextWriter txtSaida = new HtmlTextWriter(sw);
try
{
//TODO: criar CSS e remover BrowserTop
txtSaida.Write("<html>\n");
//TODO: css faz diferença?
//txtSaida.Write("<head>\n\t<link href=\"http://localhost:1364/Facin/_layouts/css/exporthtml.css\" rel=\"stylesheet\" type=\"text/css\">\n</head>\n");
txtSaida.Write("<body>\n");
txtSaida.Write("<H1>\nEventos</H1>\n");
dgEvento.RenderControl(txtSaida);
txtSaida.Write("\n</body>\n</html>");
}
catch (Exception )
{
Response.Redirect("~/Default/Erro.aspx");
}
finally
{
sw.Dispose();//FIXMW: close ou dispose?
}
Response.AddHeader("Content-disposition",
"attachment; filename=eventos.html");
Response.ContentType = "text/html";
try
{
Response.BinaryWrite(ms.ToArray());
Response.End();
}
finally
{
ms.Close();
}
}
示例12: RenderOptInStatus
public void RenderOptInStatus()
{
HtmlTextWriter writer = new HtmlTextWriter(Response.Output);
if (Customer.IsSubscribedToBroadcasts)
{
writer.Write(string.Format("<b style='color: green'>You are receiving email notifications at <u>{0}</u>.</b> | <a href=\"{1}\">Unsubscribe</a> ",
Customer.Email,
Page.ClientScript.GetPostBackClientHyperlink(this, "OptOutCustomer")));
}
else
{
writer.Write(string.Format("<b>You are not receiving email notifications.</b>"));
}
}
示例13: ExportGridToExcel
private void ExportGridToExcel()
{
Response.Clear();
Response.Buffer = true;
Response.ClearContent();
Response.ClearHeaders();
Response.Charset = "";
string FileName = "Phieu_de_nghi_Cap_" + CIPConvert.ToStr(m_hdf_ma_trung_tam.Value) + "_" + DateTime.Now.ToString("yyyyMMdd") +".xls";
StringWriter strwritter = new StringWriter();
HtmlTextWriter htmltextwrtter = new HtmlTextWriter(strwritter);
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition", "attachment;filename=" + FileName);
htmltextwrtter.Write(" ");
m_lbl_header.RenderControl(htmltextwrtter);
htmltextwrtter.WriteLine("<br />");
// tên phòng ban
htmltextwrtter.Write(" ");
m_lbl_title.RenderControl(htmltextwrtter);
htmltextwrtter.WriteLine("<br />");
//m_lbl_title_ma_don_hang.RenderControl(htmltextwrtter);
//Mã đơn hàng
m_lbl_MP.RenderControl(htmltextwrtter);
m_lbl_ma_don_hang_de.RenderControl(htmltextwrtter);
htmltextwrtter.Write(" ");
m_lbl_pop_lan_tl.RenderControl(htmltextwrtter);
htmltextwrtter.Write("   ");
m_lbl_pop_lan.RenderControl(htmltextwrtter);
htmltextwrtter.Write(" ");
m_lbl_pop_ngay_dat_hang_tl.RenderControl(htmltextwrtter);
htmltextwrtter.Write("   ");
m_lbl_pop_ngay.RenderControl(htmltextwrtter);
htmltextwrtter.Write(" ");
m_lbl_pop_tong_tien_tl.RenderControl(htmltextwrtter);
htmltextwrtter.Write("   ");
m_lbl_pop_tong_tien.RenderControl(htmltextwrtter);
htmltextwrtter.Write(" ");
m_lbl_pop_dinh_muc_tl.RenderControl(htmltextwrtter);
htmltextwrtter.Write("   ");
m_lbl_pop_dinh_muc.RenderControl(htmltextwrtter);
m_grv_don_hang_de.GridLines = GridLines.Both;
m_grv_don_hang_de.HeaderStyle.Font.Bold = true;
m_grv_don_hang_de.RenderControl(htmltextwrtter);
Response.Write(strwritter.ToString());
Response.End();
}
示例14: RenderOptionGroupBeginTag
private void RenderOptionGroupBeginTag(string name, HtmlTextWriter writer)
{
writer.WriteBeginTag("optgroup");
writer.WriteAttribute("label", name);
writer.Write(HtmlTextWriter.TagRightChar);
writer.WriteLine();
}
示例15: RenderBulletText
// Writes the text of each bullet according to the list's display mode.
protected virtual void RenderBulletText (ListItemCollection items, int index, HtmlTextWriter writer) {
switch (Control.DisplayMode) {
case BulletedListDisplayMode.Text:
writer.WriteEncodedText(items[index].Text);
writer.WriteBreak();
break;
case BulletedListDisplayMode.HyperLink:
//
string targetURL = Control.ResolveClientUrl(items[index].Value);
if (items[index].Enabled) {
PageAdapter.RenderBeginHyperlink(writer, targetURL, true /* encode */, items[index].Text);
writer.Write(items[index].Text);
PageAdapter.RenderEndHyperlink(writer);
} else {
writer.WriteEncodedText(items[index].Text);
}
writer.WriteBreak();
break;
case BulletedListDisplayMode.LinkButton:
if (items[index].Enabled) {
//
PageAdapter.RenderPostBackEvent(writer, Control.UniqueID, index.ToString(CultureInfo.InvariantCulture),
items[index].Text, items[index].Text);
} else {
writer.WriteEncodedText(items[index].Text);
}
writer.WriteBreak();
break;
default:
Debug.Assert(false, "Invalid BulletedListDisplayMode");
break;
}
}