While page is rendered server-side control <asp:TextBox
id="TextBox1"
runat="server"></asp:TextBox> is
converted to <input name="TextBox1"
type="text" id="TextBox1" />.
Is there any way to get HTML presentation of WebControl or
UserControl
at the server side?
I'll try RenderControl method:
...
StringBuilder sb = new StringBuilder();
TextBox1.RenderControl(new HtmlTextWriter(new
StringWriter(sb)));
string res = sb.ToString();
....
But it always throws the exception "Control
'TextBox1' of type
'TextBox' must be placed inside a form tag with
runat=server."
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C-Sharp (C#)" group.
To post to this group, send email to C_Sharp googlegroups.com
To unsubscribe from this group, send email to
C_Sharp-unsubscribe googlegroups.com
For more options, visit this group at http://groups.
google.com/group/C_Sharp
-~----------~----~----~----~------~----~------~--~---
|