hi all is there any asp.net server control that is not rendering in html page ?
for instance <asp: TextBox runat ="server" id="Textbox1"><asp:/TextBox>
is rendered as <input type="Text" id="textbox1"/>
?
i think you would understand my question ?
views:
46answers:
4Every class deriving from the base class WebControl
are meant to be rendered. That base class contains essentially rendering stuff such as styles and of course, the Render
method.
Of course you can override the Render
method and void it, but I don't see the advantage of having a UI control that doesn't render anything.
Both Literal
& PlaceHolder
have been designed to render stuff, but by default, they render nothing.
Use a plain class instead.
It's a bit of a guess at what you're after, but maybe <asp:HiddenField />
?
The Literal control is not rendered unless something is added to the Text property, in which case just the contents of the Text property are rendered. Likewise, the Placeholder control only renders the controls placed in its Controls collection.
<asp:Literal ID="literal1" runat="server" />
<asp:PlaceHolder ID="placeholder1" runat="server" />
The <asp:placeholder>
control.
The <asp:panel>
produces a div but the has no output but its great for adding controls without adding unwanted additional html