- Install Visual Studio
- Install Gaia Ajax.
- download a 30-days trial or
- purchase a license
- Key Features in Gaia
- About Gaia
- Considerations when choosing an ajax framework
- Read more about ASP.NET Web Forms at www.asp.net
The sample code below demonstrate all you need to know to get started with the components. This example only updates a Label on the page.
<%@ Page Language="C#"
There are three important things in the above code. First you have the Page directive which says something about your page like what language the codebehind file is in, which file implements the codebehind class and what the class name is of your codebehind class and so on. The second important thing is the Register directive which for the above scenario "imports" Gaia.WebWidgets.dll and uses the gaia prefix for giving you access to all WebControls in the "Gaia.WebWidgets" namespace. Already now you can type in "<gaia:" and get intellisense help from Visual Studio for all the Ajax Controls in the Gaia core.
The third and most important thing to understand is the declarative syntax of the Gaia Ajax Button which looks like this:
This declares at the place you are within your HTML a Gaia.WebWidgets.Button which will have the ID of "btn" and the Text of "Click me". Assuming you now have a codebehind file called Default.aspx.cs containing a System.Web.Page inheriting class called "_Default" you can now already run this and the output will look something like this:
Of course it won't do anything useful since we have no logic in it at all, but it renders its output.
Most of the Gaia Ajax WebControls inherit from their ASP.NET counterparts, which means that every single property you have in the System.Web.UI.WebControls.Button will also be available to you in a Gaia Ajax Button. And you can use most of its properties, methods and events on the Gaia Button in any event handler.
.NET have a very beautiful event/delegate system which is a true event implementation which makes it easy for your objects to signal interest in events raised by other objects. ASP.NET is a pure event based GUI system which means that when you "Click" the button above, then an Event will be raised which you can "subscribe" to in your codebehind file in C#. To subscribe to the "Click" event of the above button and set the Text property of a Gaia Label you would normally do something like this;Edit
Working Code SampleEdit
public partial class _Default : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
protected void btn_Click(object sender, EventArgs e)
lbl.Text = "Hello Ajax World 2.0";
Public Class _Default
Protected Overrides Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Protected Sub btn_Click(ByVal sender As Object, ByVal e As EventArgs)
lbl.Text = "Hello Ajax World 2.0"
Now if you compile and run the above application and then click the Button it will display "Hello Ajax World 2.0" in your Ajax Label. For those acquainted with ASP.NET AJAX you will notice that first of all there is no
UpdatePanels and no
required WebServices. In Gaia you can update any widget any place on the page from any Gaia Event Handler.
Also if you look at the request and the response with e.g. FireBug
or some similar sniffer tool you will notice the compact, secure and efficient data transfer between the client and server.Edit
The HTTP Request and Response dissectedEdit
HTTP Request to the server
HTTP Response from the server
$G('lbl').setText('Hello Ajax World 2.0');
$FChange('__VIEWSTATE', 43, 'EHgtIYXNSZW5kZXJlZGceBFRleHQFFEhlbGxvIEFqYXggV29ybGQgMi4wZGQCAw8PFgIfAGdkZGSL1pk
Important Topics to fully leverage Gaia Ajax in ASP.NET Development
- ViewState In Gaia Ajax
- Page Life Cycle Explained