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

Curing HtmlTextWriter's Ugly Formatting?

I'm creating an ASP.NET server control using the HtmlTextWriter class. My understanding is that it's a nice class to use for making sure my output HTML is valid. I assumed it would format things nicely as well, but it does a bunch of strange stuff…
Ocelot20
  • 10,510
  • 11
  • 55
  • 96
1
vote
1 answer

Writing a tag using HTMLTextWriter in C# issue

I'm trying to render a basic HTML webpage using C# and HTMLTextWriter to output to a WebBrower object, but am having issues rendering the tag in my HTML output. What I am expecting to be output..
TheAuzzieJesus
  • 587
  • 9
  • 23
1
vote
2 answers

Disposable: MemoryStream.Capacity threw an exception of System.ObjectDisposedException when generating PDF file

I'm using a Disposable pattern when generating PDF file. The following code is used: public partial class WriteNotes : System.Web.UI.Page { ... protected override void Render(System.Web.UI.HtmlTextWriter writer) { ... …
gene
  • 2,098
  • 7
  • 40
  • 98
1
vote
1 answer

getting HtmlTextWriter of a control

is it possible to get HtmlTextWriter of a control? if no, then how can i call the RenderEndTag of a control in code behind? i am facing a problem in my application. i extended the listbox user control and override its RenderEndTag event. if i…
lissa
  • 11
  • 2
1
vote
1 answer

HTML img tag does not render source image in WebKit.NET browser in C#

I'm trying to set my WebKitBrowser DocumentText to an HTML string containing a local SVG file path as image source. Actually I want to show the SVG file in a web browser. Here is my code: string SVGPath = "file:///D:/MySVGFiles…
F.Sedaghat
  • 21
  • 5
1
vote
2 answers

Use ASP.Net server control code generation from .ashx

I'm trying to take an existing bunch of code that was previously on a full .aspx page, and do the same stuff in a .ashx handler. The code created an HtmlTable object, added rows and cells to those rows, then added that html table the .aspx's…
Matt Dawdy
  • 19,247
  • 18
  • 66
  • 91
1
vote
1 answer

HtmlTextWriter create tag

How can I add target used HtmlTextWriter . I need the target='_blank'. Would some one help me. there is the code: Dim sw As StringWriter = New StringWriter() Using ht As HtmlTextWriter = New HtmlTextWriter(sw) …
user819774
  • 1,456
  • 1
  • 19
  • 48
1
vote
2 answers

Alternatives to HtmlTextWriter in a System.Web.UI.Control?

Can you use FluentHTML or other alternatives in an web application user control? Can you put a markup file in a System.Web.UI.Control like the System.Web.UI.UserControl but without the burden of the Page object? I would like to reduce the number of…
Marco Bettiolo
  • 5,071
  • 6
  • 30
  • 35
1
vote
1 answer

Why does XhtmlTextWriter ignore custom attributes?

I've found some weird behaviour and I was wondering if anyone can help out here. I'm creating a form using the XhtmlTextWriter class that inherits the addAttribute methods. I'm creating an input tag that needs a nice (HTML5) placeholder attribute.…
DdW
  • 890
  • 1
  • 18
  • 30
1
vote
1 answer

Broken htmlText in Actionscript 3.0 - funky display from incremented display using string.substring

This is an issue with textField.htmlText in actionScript 3.0 and the class I'm making for it. In an attempt not to post my whole class, I've managed to boil down the problem to what seems like a silly and almost impossible-to-overcome issue. It…
Jyoti
  • 41
  • 1
  • 6
1
vote
1 answer

HtmlTextWriter.WriteAttribute is inserting html entity references where I don't want them

For some reason the HtmlTextWriter is inserting weirdness into my html output. In the following code I try to create a clickable div that contains an image: writer.AddAttribute(HtmlTextWriterAttribute.Onclick, "location.href = '" +…
Paul Matthews
  • 2,164
  • 5
  • 20
  • 29
1
vote
1 answer

HtmlTextWriter adding a class to an element which already has one

I'm processing some objects in batches and generating some markup for them to be used within a carousel. When I'm on the last item in the batch i'd like to give that item a class so that I can style it accordingly. I'm able to give the item an…
DGibbs
  • 14,316
  • 7
  • 44
  • 83
1
vote
1 answer

HtmlTextWriter doesn't render HTML tags

I'm creating a web user crontrol, as the following output.AddAttribute(HtmlTextWriterAttribute.Style, "margin: 0 12px"); output.RenderBeginTag(HtmlTextWriterTag.Span); output.Write("test_test"); …
1
vote
1 answer

ASP.NET - Rendering Gridview to HtmlTextWriter - XLS - Column Format

I'm using the following code to render a gridview to an XLS file on an ASPX page: Private Sub ExportGridviewToExcel() Dim attachment As String = "attachment; filename=ItemSizeExport.xls" Response.ClearContent() …
Brian Webster
  • 30,033
  • 48
  • 152
  • 225
1
vote
1 answer

How to view contents of HTMLTextWriter?

I have an HtmlTextWriter object (theWriter) being passed into a method. This method is in the middle tier. I'd like to read the contents of the theWriter in debug mode. The method is: protected override void Render (HtmlTextWriter theWriter)…
4thSpace
  • 43,672
  • 97
  • 296
  • 475