Ajax Partial Rendering

When programming a web application you should consider partial rendering as the middle ground to fully fledged Ajax apps. My personal opinion is that Ajax makes life a lot easier for the user and here
I am going to show you how to add Ajax partial page rendering.

ScriptManager
The script manager manages all client side scripts that Ajax uses. By adding the script manager control to your web page you are adding the scripts that are needed to support Ajax.
These scripts are used to support partial rendering and the script manager takes care of the partial rendering cycle for you using these scripts.


Note:
You can only have one script manager to a page if you wish to add script to the same script manger use the ScriptManagerProxy.

UpdatePanel
Update panel is a section that gets updated when any of its controls cause a post back. You can have multiple update panels.

Partial Rendering
Partial rendering is when an event is fired from an update panel registered control. The script manager will take over from the post back life cycle at a
certain stage and use the xmlhttpRequest object to execute and retrieve data from the server side and display that data in the update panel area by using DOM or DHTML.
So the entire page is not being posted back and the user just experiences an asynchronous update.

XMLHttpRequest example

var request = new XMLHttpRequest();
request.open("GET", url, false);
request.send(null);
if (!request.getResponseHeader("Date")) {
    var cached = request;
    request = new XMLHttpRequest();
    var ifModifiedSince = cached.getResponseHeader("Last-Modified");
    ifModifiedSince = (ifModifiedSince) ?
      ifModifiedSince : new Date(0); // January 1, 1970
    request.open("GET", url, false);
    request.setRequestHeader("If-Modified-Since", ifModifiedSince);
    request.send("");
    if (request.status == 304) {
        request = cached;
    }
}


Partial Rendering Example
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
   
</ContentTemplate>
</asp:UpdatePanel>

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Commerce Server 2009

Via Mark Harrison.....

Commerce Server 2009 delivers the ability to increase your business reach by making it possible to sell via multiple channels by using an out-of-the-box shopping site, SharePoint Commerce Services, and the Multi-Channel Commerce Foundation. The new out-of-the-box shopping site leverages SharePoint Commerce Services, which provides a gallery of ASP.NET 3.5 Web parts and controls, a comprehensive e-commerce shopping feature-set, and technology integration between Commerce Server and SharePoint technologies. The Multi-Channel Commerce Foundation provides a new unified, extensible run-time programming model for Commerce Server, including new run-time e-commerce capabilities

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Upgrading from WSS2 to a 64 bit MOSS farm

I was helping a client upgrade their existing SharePoint Services 2 infrastructure to a shiny new 64 bit MOSS farm this week. In the process we came across a couple of problems, one trivial and one not so trivial. I've done many MOSS installs on 32 bit but this was my first 64 bit install.

Starting the installer gave the familiar response that ASP.NET wasn't enabled on IIS, please go away and fix it first. Now I am quite used to finding on a new server build that the ASP.NET v2.0.50727 extensions aren't enabled or registered on the IIS server, usually becuase the server admin has fervently applied all the updates from microsoft and hence the .NET framework has been installed before IIS. Anyhow, I opened a command prompt and issued my normal command:

c:\windows\microsoft.net\framework\v2.0.50727\aspnet_regiis -i

only to get this answer:

The error indicates that IIS is in 64 bit mode, while this application is a 32 bit application and thus not compatible. 

The solution is that on a 64 bit server there is a second framework folder in the Windows folder called framework64. Simple, eh? So correct command on 64 bit server is:

c:\windows\microsoft.net\framework64\v2.0.50727\aspnet_regiis -i

So that was fairly easy after a short google.

The second was a little more difficult to solve. Our client had some web parts that were in use in the WSS2 sites that they wanted to use in the upgraded sites, and when we installed them although the installer completed things didn't seem to run as they should. It transpires that the web parts are written on .Net 1.1 which didn't seem to be a problem in itself they should work under WSS3 and indeed we could find people with them running ok, but the difference was again the fact that we were running IIS on 64 bit Windows 2003. So by default IIS is running in 64 bit mode and as noted in the KB article below in order for IIS to use .net 1.1 you have to run it in 32 bit mode. At this point we took the decision to leave the webparts out of the final solution and keep IIS in 64 bit mode!

From KB Article ID 894435 

IIS 6.0 supports both the 32-bit mode and the 64-bit mode. However IIS 6.0 does not support running both modes at the same time on a 64-bit version of Windows. ASP.NET 1.1 runs only in 32-bit mode. ASP.NET 2.0 runs in 32-bit mode or in 64-bit mode. Therefore, if you want to run ASP.NET 1.1 and ASP.NET 2.0 at the same time, you must run IIS in 32-bit mode.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Introducing CSS grids - Part 1

Nowadays we all know that HTML tables are generally a bad idea for  formatting web based layouts, they bloat the source and reduce  accessibility, particularly hindering screen readers. 
 
They should be used sparingly and only really for data tabular in nature which would otherwise be  difficult to successfully replace with css alone.
 
Things get complicated when Content Management Systems come into play, to accommodate a large variety of possible content they frequently spit out a nested nightmare of table based layout.
 
Recently a few frameworks have been published which aim to provide better support for grid based layouts without resorting to tables, most noteworthy are Yahoo's yui grids, blueprint and tripoli.
 
Tripoli is not really a css grid framework as such, but aims to reduce cross browser css issues and provide a clean starting point by resetting all browsers to a common base line.
 
Blueprint goes a little further, offering full grid support, although the grid dimensions must be manually adjusted if the default settings prove unsuitable, Blueprint also includes css reset and more cross browser tweaks similar to tripoli.
 
Yahoo's yui grids is a fully comprehensive css grid framework catering for nearly all the screen resolution / grid combinations you are likely to need and like the others includes reset / cross browser fixes, it is a much heavier offering as a result but comes with plenty of examples and documentation plus a great online builder utility to generate the starting point html.
 
It can be argued that using these frameworks does force the inclusion of some non semantic html (a few extra divs), however we found this acceptable and a considerable improvement over even simple table based layouts.
 
Future follow ups to this article will examine  each framework in turn, with examples and comparisons to the normal tables based solutions.

Currently rated 4.8 by 4 people

  • Currently 4.75/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

ASP.net starter kits

For anybody involved in ASP.net based software development you may have noticed a suite of resources available on www.asp.net called starter kits.  I wonder though how many people have actually delved into these (I know many software companies who weren't aware of them)?

As the name suggests these starter kits are great starting point for a number of type of projects whether they are content managed websites, community websites, blogs, classified websites and so on.  We've used these as the basis for a number of developments - for example, a website that we recently developed for a property agency called Property Clever utilised the classifieds starter kit.  We did have to undertake quite a bit of customisation but I think we could reasonably estimate that the kit saved us in the region of a 3rd of the overall development timescale.  And I don't care to imagine how much time we've saved by utilising and customising the DotNetNuke CMS starter kit.

On other projects we have used components from these starter kits e.g. content manager web parts, e-commerce modules and so on.

Who says open source & Microsoft are mutually exclusive! 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

SourceSafe with Visual Studio 2008

A problem I recently encountered, I couldn't open any projects from Visual SourceSafe after installing Visual Studio 2008.

The answer - there is an update to VSS2005 that needs to be applied. The update fixes a number of other minor bugs also.

Download from http://support.microsoft.com/kb/943847

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

The benefits of using code generation tools such as SubSonic

We have been evaluating a number of code generation tools recently & the one we like the best is a tool called SubSonic

Subsonic is an open source object-relational mapper for the Microsoft .NET Framework that can really speed up the development of any software project using a database for storage.

Within minutes of completion a database design Subsonic will generate all the code for your Data Access Layer (DAL) using the ActiveRecord pattern.  In addition methods to call all Stored Procedures are generated (with a single line of code). Read only objects are also created for all defined Views.  In addition, Ruby-on-Rails like Scaffolds are generated giving you an instant web interface to enter test data into your database.

Subsonic also includes some time saving web controls, the most useful of which are:

QuickTable  - a quick and easy way to instantly show data from a table in a read only, sortable, pageable (server paging for performance)  but lightweight control (no massive viewstate here).

DropDown – in instant dropdown from any database table, no additional code required.

An intuitive query model enhances productivity and reduce even quite complex queries down to a line or two of code:

Query("Products").WHERE("CategoryID = 5").AND("UnitPrice > 10").OR("CategoryID = 1").AND("UnitPrice > 10").ExecuteReader();

Changes to your database can easily be incorporated via a web or command line based generator or for smaller sites the automatic build provider gets the job done.

The included code generation templates can easily be customised (they are simple asp.net like syntax) to cover any more specialised needs.

Having used SubSonic on a recent project (which had extremely tight deadlines) we found it an invaluable resource - reducing not only our development time, but code complexity too.  We did find the odd buglet thrown in for good measure (which you may expect from a relatively new open source project) but these were quite easy to overcome & the time savings certainly outweighed these.

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

 

Dilbert of the day