control-adapter

How to build ImageButton Control Adapter (or more general, how to build a simple control adapter)?

Hi My inspiration for this question was my discovery of the very annoying default style (border-width: 0px;) on the ImageButton web control. The simple solution is to override it by adding your own style to the control e.g. Style="border-width: 2px;". How every, it would have been nice to just make a simple control adapter that would j...

If not rendering for specific browsers, why use an adapter over extending the ASP.Net controls?

My understand of Control Adapters is that they're designed to allow different HTML rendering for different browsers (thus, you register them in the .browsers file...). However, it appears people are just registering adapters for the default browser and are using them to generally override the Render method of ASP.Net controls. Do you b...

C#.Net - RadioButton Control adapter and postback

I have a radio button control adaptor that attempts to render the radio button control with the CSS class as part of the input tag, rather than as a surrounding span. public class RadioButtonAdapter : WebControlAdapter { protected override void Render(HtmlTextWriter writer) { RadioButton targetControl = this.Control as R...

Why wouldn't the default Control Adapter mappings work on Chrome or Safari?

I have confirmed that my Control Adapters are not triggering in Chrome and Safari. I've debugged, and the breakpoints inside the adapters just don't get hit in Chrome/Safari, when they work perfectly find in Firefox/IE. So, for Chrome/Safari, IIS is just ignoring the mapping. My AdapterMappings.browser file looks like this: <browsers...

In ASP.NET 2.0 how do I remove the extra tabs and line breaks from the rendered page/control output?

I have been researching this one for awhile. I found several resources on the subject and they all tend to use the same approach - override Page.Render, use the HtmlTextWriter to convert the output into a string, and then use a series of compiled regular expressions to remove the extra whitespace. Here is an example. Well, I tried it an...