Notify smart client applications from activating Web form.

 

Although I'm not one of smart clients evangelists (I see a huge conflict between smart clients and system integration), I asked several times how can web application that start smart applications can notify smart applications. Well the trick is to embed .Net class library inside the activating ASPX page that will use remoting to notify smart client application that something happened in the activating ASPX page. I implement simple solution that demonstrate how achieve such mechanism. Note that I Just pay attention to the notify implementation, I didn’t touch other aspects such as security, Isolation storage etc.

 

As you can see in the following image the work is split between two .Net projects. Windows application and class library that serve as a gate using remoting in order to notify smart application. The SmartClientProxyClass expose single function: NotifySmartClient, that use Activator.GetObject()  to call remote object inside smart client application. I use <OBJECT> tag to embed SmartClientProxyClass inside ASPX file. From client side script I use <OBJECT> id to reference SmartClientProxyClass and call NotifySmartClient.

 

On smart client application I create three classes, WebConnector which is the remote object called from ASPX file. When smart application starts I register a listener to serve WebConnector remoting class. Controller class serves as intermediate between WebConnector and smart client form. The form registers as a listener to Controller class event and WebConnector call Controller function that raises that event.

 

Sample code.

2 Comments

Comments have been disabled for this content.