:-$

Ryan's work blog

My Links

News

The WeatherPixie
Subscribe with Bloglines
About this blog

Tools I use:

Post Categories

Article Categories

Archives

Image Galleries

Blog Stats

Personal

Projects

Random Blogs

Random other

Reference

Web comics

Work

Remote XUL and ASP.NET

I've now gotten permission to use XUL for another client, and this time around, I'm trying it a little differently.

Rather than serving up a .xul file, and doing everything with overlays, DOM manipulation, and XBL, I'm serving up a .aspx file, setting its content-type to application/vnd.mozilla.xul+xml, and then using ASP.NET to render XUL instead of HTML. Jeb (do you have a link, Jeb?) said he was creating XUL apps this way using JSP, so I figured I'd give it a try. So far I like it. This method lets me lean on my ASP.NET skills while I build up the XUL skills.

How I have it set up:

  • One .aspx page per XUL layout, using <html:a> tags to navigate between them.
  • One ASP.NET user control is on each page, ensuring all XUL layouts have the same template and include the same javascript and css files. I had tried do this with overlays, but didn't have much luck.
  • A few IHttpHandlers to send RDF to my XUL, and JSON to my javascript.
  • A few webservices that get called by my javascript, and the work is done in C#.
This seems to work pretty well. The UI and the business logic is completely seperate, and by using RDF I can take advantage of XUL templates to do lots of nifty things on the client.

For now, I'm only using this on applications that require windows authentication to access the site, so to access the web services you'll need to be logged in. Security is still a concern, though, and eventually I'll have to expose some of these web services to wild. I've been considering some token system where the server passes a token to the client when it renders the xul aspx page, and then the javascript passes that token to the web services, but I haven't fleshed anything out yet.

posted on Tuesday, October 04, 2005 6:21 PM