rendercontrol

Getting a UniqueId when using RenderControl

I'm using RenderControl(writer) on a set of ASP.NET controls to get the generated server control markup back, for a template. These are form controls, such as radioboxes, input boxes, checkboxes. The problem with this is the control's Parent.UniqueId is not set at this point, not Parent.Parent and so on. This means that the name="" attr...

ASP.NET RenderControl or RenderChildren fail

I need to use objChildControl.RenderControl or objControl.RenderChildren to manually render my child controls. But it looks like these methods are incomplete. All my child controls use the OnPreRender event to register clientscript and client stylesheets (since these can only be created in the prerender event). I have 2 main issues, pa...

RenderControl - src property is wiped after RenderControl is called with HtmlImage

Hi After I call RenderControl on a HtmlImage, the src property gets wiped e.g. public class Class1 { public static void Main(string[] args) { HtmlImage img = new HtmlImage(); img.Src = "/google.com/image.jpg"; img.Width = 40; img.Height = 40; RenderImage(...

Asp.net RenderControl method not rendering autopostback for dropdownlist

Hi all, i am bit confused as to why asp.net does not render a dropdownlist with the autopostback property set to true when using the RenderControl method. eg Dim sw As New IO.StringWriter Dim tw As New HtmlTextWriter(sw) Dim table As New Table table.Rows.Add(New TableRow) Dim tr As TableRow = table.Rows(0) tr.Ce...

Output asp.net masterpage webform to html email

Hi I'm having a bit of a nightmare here! I'mv trying output a webform to html using page.rendercontrol and htmltextwriter but it is resulting in a blank email. Code: StringBuilder sb = new StringBuilder(); StringWriter sw = new StringWriter(sb); HtmlTextWriter htmlTW = new HtmlTextWriter(sw); page.RenderControl(htmlTW); ...

Render Control to Html Produces a different string

I am trying to render a hyperlink to html. ( etc) When the page loads it works fine. (and lots 10 links) on the update panel it hits the same function and tries to get another 10 links. I set the navigationURL to something like "../Folder/Mypage.aspx?498592ghjgfosdfgo" It is set identically both times(load and updatepanel postback)...

ASP.NET MVC: How can I render a Control to a Stream?

So I'm rendering a partial view in memory in order to direct the XSL-FO data in the view to a PDF renderer. The PDF renderer can take a string, XmlDocument or Stream as input. Here is what I'd like to do: (Edited for clarity) Solution taken from: http://thriftybliss.spaces.live.com/blog/cns!58DA805F37F31F20!170.entry?wa=wsignin1.0&amp...

Add stylesheet link to dynamically created page object

I'm creating a Page object and adding a control to it for printing purposes. The code works, however I can not find a way to add a stylesheet link to the header. In the code I pasted I'm trying to add a link to the header and then add the header control to the page, but this causes an error: Request is not available in this context S...