2.07.2007

ASP.NET side basically done

I'm basically got everything on the ASP.NET backend working. ObjectFactory now returns a single object of a new class called "ObjectFactoryResponse", which includes a collection of both regular ObjectFactory objects and a collection of another new class, WebServiceControlData. WebServiceControlData contains the item's Id, the rendered HTML and a collection of ScriptDescriptors (used for sending values to AJAX Sys.UI.Controls).

It was kind of tricky getting it to render the HTML without being on a real page - I forgot/didn't realize/should've known/etc that HtmlTextWriter needs have Flush() called before it actually writes anything to the stream. I'm guessing that method is normally automatically called by the Page object. It took me a bit of playing around to figure that one out.

The really nice part is that the overall amount of work that was required to get to this point was considerably less than I thought it would be. Now I have to wire up everything on the client side, which I think will actually be quite a bit more effort, since I'm not nearly as familiar with AJAX.

Labels: , , , , , ,


ASP.NET for JavaScript rendered controls, continued

I started playing around with it last night, and already have discovered that some of my assumptions will need to be changed.


First, I can't use IScriptControl. IScriptControl depends on having access to a ScriptManager. More specifically, THE ScriptManager that will be on the actual page. So while I could just add ScriptManagers into the controls I create, it would be pointless since it would actually be able to do anything. I will still be using one method from IScriptManager though - IEnumerable GetScriptDescriptors(), but I'll have to do some research into the AJAX Sys.Component or Sys.UI.Control constructors to figure out how I can pass that info into my javascript controls.


Also, I'm 90% sure that creating my own control type is a bit unrealistic. Its completely possible - with the Visual Studio 2005 SDK, I can even create my own custom directive (like <%@ WebServiceControl ... %>), but it seems more realistic to just inherit from UserControl. The question here is whether TemplateControl.LoadControl(...) (TemplateControl is the abstract class Page and UserControl both inherit from, LoadControl allows you to get an instance of a Page or UserControl from a virtual path) will work from the WebService if I just instantiate a new object.

Labels: , , , , , , , , , ,


This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]