Questions tagged [htmltextwriter]

Writes markup characters and text to an ASP.NET server control output stream. This class provides formatting capabilities that ASP.NET server controls use when rendering markup to clients.

89 questions
1
vote
1 answer

HtmlTextWriter - Filepaths containing spaces

I'm trying to use HtmlTextWriter to create a html page which is all working fine until I try to create images into a folder that contains spaces in its file path C:\Documents and Settings.... What seems to be happening is…
Sayse
  • 42,633
  • 14
  • 77
  • 146
1
vote
0 answers

How to Read and do changes in HtmlTextWriter

In an ASP.NET site, I am rendering a GridView control to export it's details in a excel file Response.ContentType = "application/vnd.ms-excel" Response.AppendHeader("Content-Type", "application/vnd.ms-excel") Dim stringWrite As…
sunshine
  • 125
  • 4
  • 15
1
vote
1 answer

How to use .Net controls with HTMLTEXTWRITER

The code mentioned below is part of my webpart on sharepoint 2010. public class class1 : System.Web.UI.WebControls.WebParts.WebPart { protected override void Render(HtmlTextWriter writer) { string s1 = "first"; …
Mohit
  • 415
  • 2
  • 18
1
vote
2 answers

Server Control generates unexpected markup

I am building a database editor/line-of-business tool for a client using .NET 4.0, and IIS 7. I want to conditionally include some HTML in my page based on values I have stored in Session. I am doing this on the server-side, and to encapsulate the…
Thomas McNamee
  • 692
  • 1
  • 6
  • 14
1
vote
3 answers

Programmatically writing CSS in .NET

We're displaying objects within a web-page which have basic height and width properties. We can generate the HTML objects utilising the HtmlTextWriter object and plan to apply the Height and Width properties by referencing the object's ID in…
Tim
  • 298
  • 1
  • 2
  • 11
1
vote
0 answers

HtmlTextWriter & MVC 3 Razor Output

This is probably a quick fix, but I am writing to a HtmlTextWriter in my HtmlHelper and no matter what I try it is encoding the HTML so the output shows the markup. Helper: protected override void WriteHtml(System.Web.UI.HtmlTextWriter writer) …
Sam
  • 15,336
  • 25
  • 85
  • 148
1
vote
1 answer

HtmlTextWriter does not render

I am using the HtmlTextWriter to create some HTML for me. I want to test if my page actually works but it doesnt render the div. using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using…
SOLDIER-OF-FORTUNE
  • 1,634
  • 5
  • 39
  • 66
0
votes
1 answer

Html.TextWriter WriteAttribute is not rendering 2 columns in table

I want to to create a table with 2 colums in a row. Then in the next row I want only 1 colum. Here is a part of my code: writer.WriteBeginTag("table"); writer.Write(HtmlTextWriter.TagRightChar); //first…
Roger
  • 1,004
  • 2
  • 12
  • 24
0
votes
4 answers

How to write some text to an excel file in c#

I am adding the grid table to the excel and adding a header to the excel. string subject = lbl_Subj.Text; Response.Clear(); Response.Buffer = true; Response.ClearHeaders(); Response.AddHeader("Cache-Control", "no-store,…
Mark
  • 2,720
  • 15
  • 56
  • 87
0
votes
1 answer

Writing html with HTMLTextWriter in irregular order

I generate a html page with HTMLTextWriter. At one point I do need some information, which I haven't yet. I will get them later. It is not possible to workaround and to get the information earlier. Is there a way, how I can jump back as soon as I…
Em1
  • 1,077
  • 18
  • 38
0
votes
2 answers

Calculate height of a HTML-Table generated by HtmlTextWriter (C#)

I generate a HTML-Page from C#. In the HTML-Page there are a lot of elements. All of them have a absolute position. One of these elements is a table. This table represents a object that keeps a double[]. Every double value is a new cell in a new…
Em1
  • 1,077
  • 18
  • 38
0
votes
1 answer

HtmlTextWriter solution being added as a WebControl

I have a solution that works, yet it doesn't meet the QA requirements from the customer. Problem is I can't control the location of the WebControls, they need to be relative to a chart that is above these. How I see it, I need to "compile" the…
DoStuffZ
  • 785
  • 15
  • 37
0
votes
1 answer

Convert ASPX page to string without triggering the 'needs to be placed inside a form with a runat="server"' message

I'm trying to scrape my own ASPX page so that I can feed it into HTML Agility Pack parser. I've tried all ways and a string is the only thing I can get to work in this instance. I'm using the following code to turn an outer control into a string: …
John Ohara
  • 2,821
  • 3
  • 28
  • 54
0
votes
2 answers

External Style Sheet not working with HtmlTextWriter

I am trying to generate a Pdf from Html string using DynamicPdf.HmtlConverter library. For generating Html string I am using HtmlTextWriter class from System.Web.UI. I am trying to add the external style sheet as follows : StringBuilder sb = new…
0
votes
1 answer

Is there any problem with mixing WriteBeginTag and RenderBeginTag in the same code?

I am generating XHTML for a non-standard browser (Polycom Microbrowser). I would like to use the XhtmlTextWriter, but it ignores the border attribute on table. This is mostly like the correct thing to do since you should be using CSS to set the…
chrish
  • 2,352
  • 1
  • 17
  • 32