Blue Theme Orange Theme Green Theme Red Theme
 
DevExpress Free UI Controls
Home | Forums | Videos | Advertise | Certifications | Downloads | Blogs | Interviews | Jobs | Beginners | Training
 | Consulting  
Submit an Article Submit a Blog 
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
Team Foundation Server Hosting
Search :       Advanced Search »
Home » Internet & Web » 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 : 33651
Downloads : 776
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
 
 
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
DevExpress Free UI Controls
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.
Discover the Top 5 .NET Memory Management Fundamentals
To write the best .NET code, you need to know exactly how the .NET framework really manages memory. Ricky Leeks presents the Top 5 fundamental facts of .NET memory management. Learn more.
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:
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
 Comments
Ajax -Object not set to an instance of an object by Gayu On March 27, 2006
This code works fine in my local system.But when i tried uploading the webpage in the server it shows the following error.pls help Object reference not set to an instance of an object. NullReferenceException: Object reference not set to an instance of an object.] MagicAjax.AjaxCallHelper.GetPageHiddenDictionary(Page page, String fieldName) +34 MagicAjax.AjaxCallHelper.Page_PreRender(Object sender, EventArgs e) +245 System.Web.UI.Control.OnPreRender(EventArgs e) +2066940 System.Web.UI.Control.PreRenderRecursiveInternal() +77 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
Reply | Email | Modify 
Excellent by Saroj On July 14, 2006
Excellent ONe
Reply | Email | Modify 
]]]] by Dilipkumar On August 24, 2006

Keeping Datalist control inside Ajax control works fine. But I have following problem :

I am having datalist control which have dropdown list in it's each row. I want to handle postback of dropdown control inside datalist. In normal case, without AJAX I can handle it easily by specifying handler.

But, When I keep datalist control inside Majic AJAX,  aplication crashes.

Can anybody help me in this.

Regards,

Dilip.

Reply | Email | Modify 
ajax intro by vishakha On January 26, 2008
Hi I want complete introduction for ajax as i am new to it and havent learnt.can anyone tell me some sites to learn or tutorials.plz help. vishakha ujjainkar 9221339392 vishaujjain12@gmail.com
Reply | Email | Modify 
Re: ajax intro by Muhammad On February 12, 2008
www.asp.net and www.asp.net/ajax are the best starting resources for that. Videos and tutorials are available there
Reply | Email | Modify 
Need Samples by zohra On February 28, 2008
Assalam..... Loooking for a sample code in C#.net for grid Specificaly to avoid postback in Grid for all operations ....Zor
Reply | Email | Modify 
Discover the top 5 tips for understanding .NET Interop
 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.