America/US Samples
Europe Samples
Asia Samples

A Simple Chess Game for ASP.NET

Creating a Chess game is fairly simple with Gaia Ajax. Three different custom server controls where created to simulate the Board, Square and Piece. The object model was developed separately and is presentation layer independent.


Note: This chess game is not complete. It was only created to serve as an example of how to use Gaia Ajax to created sophisticated UIs. Certain moves are not yet implemented and the game currently halts when the king is checked. Feel free to complete the game and publish it on CodeProject if you want.

Who's turn

zWhosNext

black-rook-a8
black-knight-b8
black-bishop-c8
black-queen-d8
black-king-e8
black-bishop-f8
black-knight-g8
black-rook-h8

black-pawn-a7
black-pawn-b7
black-pawn-c7
black-pawn-d7
black-pawn-e7
black-pawn-f7
black-pawn-g7
black-pawn-h7





white-pawn-a2
white-pawn-b2
white-pawn-c2
white-pawn-d2
white-pawn-e2
white-pawn-f2
white-pawn-g2
white-pawn-h2

white-rook-a1
white-knight-b1
white-bishop-c1
white-queen-d1
white-king-e1
white-bishop-f1
white-knight-g1
white-rook-h1


Markup (ASPX/.aspx)

   1:   
   2:   
   3:  <div class="current-player">
   4:      <p>Who's turn</p>
   5:      <gaia:Image ID="zWhosNext" runat="server" ImageUrl="img/white_pawn.png" />
   6:  </div>
   7:   
   8:   <br style="clear:both;" />
   9:      
  10:      <gaia:Panel 
  11:          runat="server" 
  12:          ID="c">
  13:          
  14:      </gaia:Panel>
  15:   
  16: