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.
Questions tagged [htmltextwriter]
89 questions
0
votes
2 answers
How can I make an HtmlTextWriter object use spaces instead of tabs for its Indents?
I am creating some html from code running on a WinForm. I want to create the following html:
I'm using the System.Web.UI.HtmlTextWriter class to do this like…
foo

aranasaurus
- 345
- 1
- 3
- 13
0
votes
1 answer
Is there a way to remove attribute after calling `AddAttribute`
Is there any way to remove attribute after the attribute was added by AddAttribute (msdn)?
Example:
public static void GenerateFieldInput(HtmlTextWriter writer)
{
writer.RenderBeginTag(HtmlTextWriterTag.Input);
…

Shahar Shokrani
- 7,598
- 9
- 48
- 91
0
votes
1 answer
How to generate Form's OnSubmit attribute with HtmlTextWriter
I need the Html will be something like:
I'm generating it with
HtmlTextWriterAttribute key;
string value;
using (HtmlTextWriter writer = new HtmlTextWriter(new…

Shahar Shokrani
- 7,598
- 9
- 48
- 91
0
votes
1 answer
Using string array inside HtmlTextWriter
I am building a web application using ASP.NET C#. I have a string array of image urls. I am trying to display all of these icons on the page. They are retrieved from a web api so they are different every time and there are about 300 of them.
I found…

SlothGod
- 356
- 1
- 4
- 19
0
votes
1 answer
Creating dynamic posts with htmltextwriter and submitting to the database
I've created a page with dynamic posts that I'm getting from the database. Inside each post I need to have a button that when the user clicks on, it'll change a value in the database.
I've tried so many different things. Initially I started off…

user7703048
- 1
- 1
0
votes
0 answers
How to send Chart Control in email using C# ASP.Net
I have written the below code to send the Gridview and Chart Image in email body message (not as an attachment) using C# ASP.Net.
StringBuilder sb = new StringBuilder();
string MailSturcture;
using (System.IO.StringWriter sw = new…

Arun
- 728
- 4
- 16
- 30
0
votes
1 answer
Fire server event from client
I am having trouble with the Asp.net page life cycle. I am trying to create a custom menu using HtmlTextWriter with an asp.net LinkButton to fire a server event. I can not get the server event to fire and I get the 'object reference not set to…

trevorc
- 3,023
- 4
- 31
- 49
0
votes
1 answer
Could you explain Methods about protected override void Render(HtmlTextWriter hw)
i have some curiosities about Method name is Render.
There are some code examples about printing Page Index Number,
[Paging.cs source]
protected override void Render(HtmlTextWriter hw)
{
StringBuilder sb = new StringBuilder();
…

Popcorn
- 81
- 1
- 8
0
votes
1 answer
HtmlTextWriter wrapper to HtmlHelper.ViewContext.Writer wrong date format
I have a very large set of controls that generates allot of Html content in the Response(HtmlTextWriter writer) method using HtmlTextWriter.WriteLine(format, params object[] args)
If I try to use this in MVC with a HtmlHelper
I get the following
var…

Steve
- 1,995
- 2
- 16
- 25
0
votes
0 answers
How to see xml child nodes in XmlTextReader
I'm reading through a large XML file and parsing it into HTML.
My current challenge is that child nodes can contain information regarding its parent. If you look at the code below, the panel is its own XML node and can contain XML attributes that…

Andrew Nielsen
- 113
- 1
- 8
0
votes
1 answer
How to add new header line asp.net Response.Output.Write?
I have a grid-view and I exported to grid-view data to word as shown below. The grid-view data and style works as I expected. Now I want to and new header line to word document and than send my grid-view data
under it. I have to add heading to word…

NTMS
- 816
- 7
- 22
0
votes
0 answers
HtmlTextWriter Output attribute with Single quotes
I need to output an attribute with single quotes using htmltextwriter.
Any idea how to achieve this? I've writter the whole file already using htmltextwriter - so I do want to use this object to generate the file. Maybe override it? It needs to…

Martin Thompson
- 3,415
- 10
- 38
- 62
0
votes
1 answer
Remove tag from HtmlTextWriter
I am receiving text to a function public void LoadMarkup(HtmlTextWriter writer){} and I need to remove last tag from it.
The text I am getting is:
Name:
![]()
Nitin Katiyar
0
votes
2 answers
Exception safety/handling with .Net HtmlTextWriter?I am using a .Net HtmlTextWriter to generate HTML.
try
{
htw.RenderBeginTag( HtmlTextWriterTag.Span );
htw.Write(myObject.GenerateHtml());
htw.RenderEndTag( );
}
catch (Exception e)
{
GenerateHtmlErrorMessage(htw);
}
In this example,…
![]()
tpower
0
votes
0 answers
select control rendered using htmltextwriter not available in Request.Form in Asp.netI needed a listbox with groups and for that I placed a literal control in page and I rendered a select control using HTMLTextWriter to the literal control. It rendered perfectly.
Problem is I am not able to get the select control from Request.Form…
![]()
Binil
|