re: Custom Server Controls via XHTML with Visual Studio

From ScottW

IMO, people just don't get custom controls yet. I think they will eventually get it, but it will take some time. At the moment, there is still very little information on the subject out there (I am helping with this, check back in a couple of months :D). There is the MS Press book (which is great), but otherwise, there is very little info available.


Developers still have a problem understanding Internet Explorer’s Behavior Technology (both Element and Binary), which is the client-side equivalent of .Net Custom Controls, and they have been out since IE 5.5.  I have an Element Behavior Yahoo Discussion Group, which gets very little interest.  I thought that with the advent of the server side equivalent, that Behaviors would take off, but a year later, and nobody groks it.  The IE Web Controls in .Net is a great example of what can be done combining these two technologies, where you have a server-side object model that is mirrored on the client, and the two can work together to give a much richer UI experience (and even drop down from downlevel browsers).

And to make matters worst, you can not use custom controls in ASP.NET if you wanted to use the XML/XSL model of generating web pages.  In a perfect world you could use the XML/XSL model to generate a stream that contains (X)HTML, along with custom controls, and ASP.Net would then render the complete page.  This way you could encapsulate the logic in a reusable .Net library and keep the XSLT pretty simple (plus you keep the logic in one place).

I’ve got great examples of Element Behaviors on my old site, but they both use SVG and require SVG.

Stacked Bar Graph
Angular Gauges

Don XML

3 Comments

  • I tried to use IE Behaviors for an intranet project I was working on in 2000, but the company wouldn't roll out IE5.5 (due to a problem it had printing their FedEx labels, strange but true). Since then, I've been writing web apps more than intranet apps and don't feel that writing for IE is acceptable. I make every single dollar of my income from MS products and apps, but I don't use IE as my browser more than 50% of the time.


    Strangely enough, though, an OSS guy I work with writes almost completely for IE and doesn't even bother with the other browsers, 180 degrees from his stance on servers and programming languages.

  • IMHO, IE behaviors are more trouble than they're worth, unless you want to fire custom events from your component. Otherwise, script is perfect





    I've written a number of ASP.NET custom controls that use (cached) XML and XSL to render pieces of user interface on pages, like toolbars and such, so I'm not sure what you mean by "you can not use custom controls in ASP.NET if you wanted to use the XML/XSL model"

  • I believe Don means that we can't generate HTML with Asp.Net tags and get that to compile and run.





    We could however dynamically create an user control using XSLT, save that to disk and then use the LoadControl() method to load and run it. This obviously has overhead with the file IO. A pity LoadControl() doesn't take a stream as well as a file path.

Comments have been disabled for this content.