By Jon Henning on
11/12/2008
As mentioned in Part II of this series, this entry will focus on another advantage of writing rich client side objects representing our modules on the client side. One very common use case that comes up again and again is how can one module talk to another on the same page. For a long time DotNetNuke had this capability from the server side through something called...
Read More »
|
By Jon Henning on
11/11/2008
In part one of this series I mentioned that the Microsoft AJAX Framework along with the ClientAPI are different than a lot of other javascript frameworks since they allow for an end-to-end integration directly with .NET. This entry will discuss how the this integration makes life easier for a DotNetNuke module developer by allowing communication to and from the server to be simple.
The Microsoft AJAX Framework allows for server-side code to add a reference to the js file, initialize the client-side...
Read More »
|
By Jon Henning on
11/10/2008
With the release of DotNetNuke 5.0 drawing near, I figured it would be good to provide an introduction as to how nice client-side module development can be with the integration of the Microsoft AJAX Framework and the ClientAPI 4.0. This mini-series of blog entries will cover the basics of how to get started by creating a sample module that
Utilizes client-side javascript objects to encapsulate our logic, easily allowing multiple instances of a module on a page without having our variables clash Utilizes the Microsoft AJAX Framework to allow for variables to be initialized in our client-side objects Utilizes the new ClientAPI ControlMethods to allow for communication of complex objects both to and from the server Enables localized messages to be sent down to the client-side javascript Enables client-side Inter-Module Communication (IMC) If your new to javascript, you may be confused as to where to get started. As there are many frameworks out there, it can be overwhelming as to which one to choose. One of the advantages of using both the Microsoft AJAX Framework and the ClientAPI is they both have been written to allow for easy integration with the server-side logic, whereas other frameworks may have the ability to make AJAX calls, they do not have included ASP.NET server-side code to handle easy integration with your VB/C# code.
Another vital piece of information that you should understand is that javascript is more of an emulation (prototype) language than a real language. It has the ability to morph itself to do common programming constructs like objects, events, inheritance, enumerators, etc. However, it does not have these things out of the box. Thus, a framework like Microsoft’s, is nice since it will provide a formalized way in which objects get defined and inheritance happens. For more information how this has been formalized see this document.
Let’s assume you already have a sample module you are working on and it has a typical Edit Usercontrol associated called EditDNNAjaxModule1.ascx. A convention that I like to follow is to create my javascript file with the same name plus a .js extension (EditDNNAjaxModule1.ascx.js). This keeps the files near each other in the Solution Explorer. Another assumption we will make is that we plan on creating a namespace for our controls using a company name which is a common practice in writing server-side modules that we will apply to the client. To do this, we simply declare our namespace at the top of the js file.
Type.registerNamespace('YourCompanyHere');...
Read More »
|
By Jon Henning on
4/13/2008
While sitting at the airport waiting for my plane to depart to the MVP Summit, I decided to spend a little time optimizing the new ClientAPI (codenamed Caspian) for the Cambrian release. One of the new features for this release was to allow the output of the ClientAPI and Webcontrols to emit compliant markup (more detail mentioned in this blog). There was two areas that this affected my code.
Read More »
|
By Jon Henning on
3/24/2008
The whole idea of the $ function and who "owns" that "namespace" has become quite muddy. When I first learned of the use of $ and found that MS was adopting the same notation, I decided to do it as well. For at the time, I felt that all frameworks simply used it as a quick way to get the reference to a DOM element. Soon afterwards I learned that frameworks like prototyle use it for much more.
Read More »
|
By Jon Henning on
10/5/2007
Ever since version 1.0 of the Solpart menu, it supported animations. Unfortunately, these animations were specific to IE due to it being the only browser that supported transitions natively. When I created the DNNMenu I had decided not to go this route, but rather seek out a technique that worked across all browsers. When I was first reviewing the Atlas bits, there was a portion called Glitz, which I had anticipated would support the animations I was looking for. Unfortunately, Glitz never became an official...
Read More »
|
By Jon Henning on
6/15/2007
One interesting enhancement that the AJAX Control Toolkit team came up with in the latest release is yet another way to register your scripts (ToolkitScriptCombiner). Earlier I blogged on the fact that Microsoft can’t seem to make up its mind on how these things should be registered. In the Control...
Read More »
|
By Jon Henning on
6/15/2007
I have finished the initial conversion of the DotNetNuke WebUtility (ClientAPI) project to utilize the Microsoft ASP.NET AJAX Extension framework. This has several advantages and one major disadvantage. The disadvantage is that upgrading to it will require Microsoft ASP.NET AJAX extensions (System.Web.Extensions.dll) to be installed. I do not have the time, nor do I think it worth the effort, to provide an optional install. Technically, since the current implementation does not require the extensions and...
Read More »
|
By Jon Henning on
4/13/2007
I will be releasing the next point release of DotNetNuke WebControls (v1.5.3) shortly. There are a couple reasons for this. First, it was detected by some users that the currently released version with DNN 4.5 was compiled in Debug mode, thus affecting performance a little. The second, and primary reason is due to our desire to try (emphasis on this word) and maintain compatibility with other AJAX frameworks. In this case we are talking about prototype.
...
Read More »
|
By Jon Henning on
3/2/2007
Being able to retrieve and set personalization values on the client is a new feature that DNN will support for version 4.5. Since personalization is something specific to DNN, the code will reside in the DNN specific ClientAPI files of dnncore.js and DNNClientAPI (ClientAPI.vb). The current state of the dnncore.js is such that it does not utilize namespaces. Instead it prefixes all function names with __dnn_. Module developers use these client-side functions when they are calling server-side methods like...
Read More »
|