Hi, I'm developing an ASP.NET framework for web applications and I'm using jQuery and AJAX to allow users to create content in a modal dialog, rather than navigating to different pages. As I intend to use the framework for different sites I am trying to abstract the UI from the logic.
My problem is this. I have a control that allows the user to enter content. The control delivers the content via an AJAX call to the logic part of the framework (via a Web Service). I want the content to be displayed without having to refresh the page but I don't really want to build UI components in Javascript as I already have a control to display the content.
However the logic layer doesn't know which control to load because it might be different for other sites, and I don't want to break the abstraction by hard-coding a reference to a control. I don't want to do another round trip to the server in order to load the content back out of the database when I already have enough information to display it.
Does anybody have any clever ideas on how I can loosely couple the two?
TIA