Blue Theme Orange Theme Green Theme Red Theme
 
6 Months Free & No Setup Fees ASP.NET Hosting!
Home | Forums | ASP.NET 2.0 Tutorials | Web Services | How Do I...? | Class Browser | WPF Quick Starts | Advertise with Us
 | Consulting  
Submit an Article Submit a Blog 
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
6 Months Free & No Setup Fees ASP.NET Hosting!
Search :       Advanced Search »
Home » ASP.NET » Introduction to the MagicAjax.NET - The Magic Ajax Engine for .NET

Introduction to the MagicAjax.NET - The Magic Ajax Engine for .NET

MagicAjax.NET is a free open-source framework, designed to make it easier and more intuitive for developers to integrate AJAX technology into their web pages, without replacing the ASP.NET controls and/or writing tons of JavaScript code.

Author Rank :
Page Views : 3138
Downloads : 52
Rating :
 Rate it
Level : Intermediate
   Print Read/Post comments Post a comment  Similar Articles  
   Email to a friend  Bookmark  Author's other articles  
Download Files:
MagicAjaxDemo.zip
 
 
Nevron Gauge for SharePoint
Become a Sponsor
 Tag Cloud
 Latest Jobs
More ... 
 Latest Interview Questions
More ... 

Introduction

From MagicAjax.NET web site - "MagicAjax.NET is a free open-source framework, designed to make it easier and more intuitive for developers to integrate AJAX technology into their web pages, without replacing the ASP.NET controls and/or writing tons of JavaScript code. Just as a plug & play component."

Definition of AJAX

Asynchronous JavaScript And XML, or its acronym Ajax (Pronounced A-JAX), is a web development technique for creating interactive web applications. The intent is to shift a great deal of interaction to the web surfer's computer, exchanging data with the server behind the scenes, so that the entire web page does not have to be reloaded each time the user makes a change. This is meant to increase the web page's interactivity, speed, and usability. read mode

Thanks To

First and before we proceed, I'd like to thank the pioneer developer who brought this component to us, he is Argiris Kirtzidis, who first publish MagicAjax.Net as an article on CodeProject.

What is this article about

This article is about to show how to use MagixAjax.Net as plug & play component in ASP.NET Applications. Which saves time and improve the performance of your web applications.

Assumptions

This article assumes that you are familiar with ASP.NET and its controls as well as ADO.NET.
Also you may need to
download the MagicAjax.Net from http://www.magicajax.net

Configure Your ASP.NET Application to be ready for MagicAjax.NET

  • Copy MagicAjax.dll into your bin folder
  • Modifying web.config:
    The MagicAjaxModule should be registered in the system.web section of the web.config file of your application, like this:

    <httpModules>
    <add name="MagicAjax" type="MagicAjax.MagicAjaxModule, MagicAjax" />
    </httpModules>

    MagicAjax will work with the default configuration options.

Create simple page & registering MagicAjax.Net controls on page

  • Create a simple page.
  • Add Reference to MagicAjax.dll to your project.
  • A tag prefix should be registered for MagicAjax's controls namespace at the top of the page like this:
    <%@ Register TagPrefix="ajax" Namespace="MagicAjax.UI.Controls" Assembly="MagicAjax" %>
  • Add the AjaxPanel Control
    <ajax:AjaxPanel id="AjaxPanel1" runat="server"><%--Your Controls Gose Here --%></ajax:AjaxPanel>
  • Now add a DataGrid Control inside your AjaxPanel. You can do that using the VS.NET designer

Query your DataSource

DataSet the returns set of Products from Northwind database. Do that by any mean you'd prefer.

private DataSet GetDataSet()
{

SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["NWConn"]);
SqlDataAdapter adapter = new
SqlDataAdapter("SELECT ProductName, UnitPrice FROM Products", conn);
DataSet ds = new
DataSet();
adapter.Fill(ds);
return ds;

}

Implement Paging

Suppose you want to do paging on your DataGrid, implement the PageIndexChange of your DataGrid.

private void grdProducts_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{

grdProducts.CurrentPageIndex = e.NewPageIndex;
DataSet ds = GetDataSet();
grdProducts.DataSource = ds;
grdProducts.DataBind();

}

Also you may code your page load, something like the following:

private void Page_Load(object sender, System.EventArgs e)
{

if(!IsPostBack)
{

grdProducts.DataSource = GetDataSet();
grdProducts.DataBind();

}

}

Also you may would like to do sorting, edit and update of your data inside your gird. All this is supported, Just do it as you usually do. And after finishing, put your DataGrid or any other control inside and AjaxPanel just as plug & play, and watch the magic of The MagicAjax.Net.

Conclusion

At the time of writing this article, MagicAjax Release a major release of the component, it MagicAjax.Net 0.3.0. I'm sure you may find some bugs or features that may need improvements during working with the control. Just read the documentation that comes with the component, and have a log at the change log as well.

Also MagicAjax.Net support ASP.NET 2.0, so you can use it also in VS.NET 2005

Have fun with AJAX.

Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post Here.
Login to add your contents and source code to this article
 [Top] Rate this article
 
 About the author
 
Muhammad Mosa
Muhammad M. Mosa Soliman: Software Engineer, graduated from the Faculty of Computers & Information Systems year 2003-Ain Shams University- in Cairo. Working with Microsoft .NET technology since early beta releases. Main experiance based on ASP.NET, SharePoint Portal 2003 & SQL Server. Worked as trainer for Microsoft .NET for 2 years in Cairo. Likes to read about new technologies and self-learning. Extremly Hard worker when motivated. MCT MCSD.NET MCTS: .Net 2.0 Web/Windows Applications MCPD: Enterprise Application Developer MCTS: WSS 3.0 & MOSS 2007 Config
Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
 
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
ASP.NET 4 Hosting
Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites – Click Here!
 
 Post a Feedback, Comment, or Question about this article
Subject:
Comment:
Nevron Gauge for SharePoint
Become a Sponsor
 Comments
How to create Chatting application in browser? by sagar On January 31, 2011
Tahnks for uploading such nice tutorials .I want to know. How to create Chatting application in browser withot using socket & remoting techniq.I want siply asp.net techniq to create chatting application . Please help me .Thanks again.
Reply | Email | Modify 
Team Foundation Server Hosting
 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.