asp.nethtml.net-3.5custom-server-controls

Is it possible to force a WebControl to render as a <div> instead of a <span>?


How can I force the WebControl to render as a <div>? Currently, it renders as a <span> and our UI guy prefers it be a <div>. To accommodate him, I'd like to see if this is possible and if so, how it's possible.


Solution

  • Yes, it is definitely possible. Asp.net gives you full control over the output rendered.

    Take a look at Control Adapters

    The asp.net team has released many adapters for CSS friendly rendering for controls like Menu, TreeView, and FormView. Take a look at CSS friend control adapters

    You can always build your own to customize the rendering as needed by your UI guy.