Simple ajax
How to utilize tiles for simple ajax behaviour

This tutorial covers adding ajax updates to an existing application. This creates a hybrid ajax application. If you are looking for a fully fledged ajax application take a look at the Multi screen ajax updates tutorial.
So back to this tutorial we have a page(Home/Index) and we want to update one part(Tab)

Page=
whole page
Part to update

To accomplish this we change the HomeController class from ...
public ActionResult Index()
{
  ViewData["Message"] = "Welcome to ASP.NET MVC!";
  return View();
}
...

to ...
public ActionResult Index()
{
  return Home();
}

public ActionResult Home()
{
  ViewData["Message"] = "Welcome to ASP.NET MVC!";
  return View();
}
...

This allows us to creates different view for Index and Home. The old tiles.xml looked like

...
<tile name="Home.Index" extends="Default.Page.Layout1">
  <attribute name="title" type="String" value="Home Page"></attribute>
  <attribute name="body" value="Views.Home.Index.tile"></attribute>
</tile>

<tile name="Home.About" extends="Default.Page.Layout2">
  <attribute name="title" type="String" value="About Us"></attribute>
  <attribute name="body" value="Views.Home.About.tile"></attribute>
</tile>
...

we need partial views to update just the tab content.

...
<tile name="Home.Index" extends="Default.Page.Layout">
  <attribute name="title" type="String" value="Home Page"></attribute>
  <attribute name="body" value="Home.Home1"></attribute>
</tile>

<tile name="Home.Home" path="Views.Home.Home.tile1"/>

<tile name="Home.About" path="Views.Home.About.tile2"/>
...

  1. The body, tab content, if "Home.Index" is extracted in a seperated tile, "Home.Home".
  2. The body, tab content, if "Home.About" is stripped to the tab content only.
We now have to partial views.

Now we add some ajax to the tab navigation in the /Shared/Menu.tile <ul id="menu">
  <li>
    <a id="menu_to_index" href="javascript:goto('<c:url value="~/Home/Home"/>');">Index</a>
  </li>
  <li>
    <a id="menu_to_about" href="javascript:goto('<c:url value='~/Home/About'/>');">About</a>
  </li>
</ul>

The goto method is defined as function goto(url){
  new Ajax.Updater('content', url, { method: 'get', onComplete: updatePage });
}

The updatePage method is only there for tutorial purposes. It generates a blink after update. So you can see what is updated. You can use null instead. The Ajax.Updater method is defined in prototype.js and this is basicly all for making single ajax updates.

Contact form fixed

I regret reporting that the contact form was broken for the last week. All mails send to us were corrupted(empty). So reported bugs in the last week are not received. I'm aware that the timing with regards to the monorail release isn't very handy. The contact form is fixed now. I apologize.

4 February, 2010

Monorail released M5

Monorail is released. The release also contains some minor fixes.

23 January, 2010

Monorail almost finished

Maikel Willemse is coding a Monorail view engine. It's available in the nightly release. A tutorial and a new release will be available shortly.

2 January, 2010

No more tiles.xml
(if you like)

A NSTL view engine is now available. You can do SharpTiles without having a tiles.xml. You will lose the power of dependency injection. If you are interested check out the tutorial page.

21 July, 2009

Developer M3 released

Fixed a couple of parse bugs. Cleaned up refreshing of resources, resource locations and registration of the TilesViewEngine. Wrote some tutorials
Ronald Dehuysser contributed the <tiles:insertTemplate/> and <tiles:putAttribute/> tag.

8 June, 2009

HtmlHelper wrapped II

Updated tag reference documentation.

5 April, 2009

Ready for MVC RC 2

SharpTiles is now ready to use with MVC RC 2.

6 March, 2009

HtmlHelper wrapped

The MVC HtmlHelper is now wrapped and can be used. For it's only available in the nightly build. When the documentation and new Tutorials are made a new release will be made.

22 December, 2008

Ready for Beta 1

SharpTiles is now ready to use with MVC Beta 1. The tutorial page will be updated soon.

3 November, 2008

We've got Tiles

It took me a bit longer than expected but Milestone 1 is reached. Tiles are now available.

23 July, 2008

First release

Finally, after some hard work my pet project is ready for its initial release. Here it is! Please give it some thoughts and feel free to add comments.

23 May, 2008

SID: PopUp 0