Create a Web Site that uses Ajaxna.

This tutorial will show you how to create a new "Web Site" or "Web Application" in Visual Studio 2008 or Visual Web Developer 2008 (VWD) that uses Ajaxna.

This tutorial assumes you have added the Ajaxna Control to your toolbox: Getting Started - Ajaxna setup in your Toolbox

Note: Project templates will be provided to make this foolproof but for now here are the simple steps required.

Tasks - high level
  1. Create a web site
  2. Drag the AjaxnaControl onto our web page (WebForm)
  3. Register the HTTP callback handler (using the from the smart tag option to do this for us).
  4. Copy the Ajaxna Javascript references (for intellisense) into a local javascript file, places in our site root called, "namespace.js_".

Tasks - in detail
  1. Open Visual Web Developer (VWD) and from the "File" menu choose "New Web Site..." or "New Web Application...". Call it anything you like.
  2. Once the site/application is created, click on the "Default.aspx" page created for you and click the "Design" tab to display it in design mode.
  3. Drag the AjaxnaControl into the top of your page (so it is added just after the Form tag in your page).
  4. Click on "Source" or "Split" view. Your page markup should now look like this:
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register assembly="Ajaxna" namespace="Ajaxna" tagprefix="Ajaxna" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
    <Ajaxna:AjaxnaControl ID="AjaxnaControl1" runat="server"></Ajaxna:AjaxnaControl>
  1. Go back to "Design" view and open the "smart tag" for the control (if not already open - it's the small arrow on the top right of the control) and click the link, "Register Ajaxna as resource handler (required)". This will add an HTTP handler to your web.config file to handle server requests back into the library (ajax http requests).
  2. Now click the "View javascript references" link. A dialog form will open containing a list of javascript references.
  3. Click the "Copy to Clipboard" button and then "OK".
  4. Right Click on your web site in Solution Explorer and Select "Add new item...". Choose "JScript file" and call it , "_namespace.js"
  5. When the file has open, press CTRL+V to paste the references in. This file contains your Ajaxna references. Save the file.

You are now ready to begin using Ajaxna in your web site.

Last edited Aug 14, 2009 at 11:04 PM by VR2, version 4


No comments yet.