Learning ASP.Net AJAX (1)

November 16th, 2006 · No Comments

Email This Post Email This Post

I am doing ASP.Net programming (using C#) these few days and I am thinking of a way to display interactive contents without post back the page. For example, there are two DropDownList, cboCategory and cboProduct respectively. If user clicked on cboCategory, all related products under the selected category will be displayed in cboProduct. In normal ASP.Net way, it requires a PostBack to the same page.

It is not entirely true actually after seeing a Client CallBacks feature in 2.0 (see here for an article), but there is another new framework for ASP.Net called AJAX (official website here), which allows portion of the page to change without affecting others. This is something similar to Yahoo! Mail Beta or Hotmail Live.

After installing Extensions package from official website, if you attempts to drag-and-drop an AJAX control to your page, you may receive red underlined code indicating the keyword not recognized. To solve this, paste the following portion to your web.config (under configuration -> system.web):

<pages>
<controls>
<add tagPrefix=”ajax” namespace=”Microsoft.Web.UI” assembly=”Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>
<add tagPrefix=”ajax” namespace=”Microsoft.Web.UI.Controls” assembly=”Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>
<add tagPrefix=”ajax” namespace=”Microsoft.Web.Preview.UI” assembly=”Microsoft.Web.Preview”/>
<add tagPrefix=”ajax” namespace=”Microsoft.Web.Preview.UI.Controls” assembly=”Microsoft.Web.Preview”/>
</controls>
</pages>

The red line will then be gone.

Related posts:

  1. Learning ASP.Net AJAX (2)


Tags: Programming

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment

CommentLuv badge

© 2006–2010 Now Eating — Sitemap

Switch to our mobile site