AJAX Control Toolkit

How to publish an AJAX enabled,

with the AJAX Control toolkit, web application with Visual Studio 2008 on your Mochahost hosting server.

  1. Prerequi sites:

Visual Studio 2008

.NET Framework 3.5 sp1

ASP.NET 3.5

AjaxControlToolkit

  1. AjaxControltoolkit.

In this manual we will setup a new subdomain called demo.pureautomation.be and we will publish an ajax enabled web application with visual studio 2008. The web application uses the AJAX control toolkit

Follow these steps:

  1. First create a new subdomain or virtual directory on your control panel (plesk)

a. Goto your plesk control panel and click on the Subdomains icon

b. Click on Create Subdomain

c. Select Subdomain on subfolder if you want to create a subdomain on a subfolder of your maindomain.

d. Select only the asp.net option

Attention: if you remove files from your maindomain don't delete or remove all the subfolders. One of them will be this subdomain !

f. The subdomain is succesfull created when you see following message

  1. Check if ASP.NET 2.0 is enabled on your virtual directory or new subdomain.

Attention: if you don't select the ASP.NET 2.0 version a wrong web.config file will be generated. You can manually change the web.config file afterwards.

a. Goto your plesk panel and your subdomain (subdomains-> select new created subdomain)

b. on your control panel (plesk panel) click the asp.net settings

c. You see following panel. Check your values and check the ASP.NET version! 2.0.50727

  1. Make a copy of your subdomain or virtual web directory and files so you have the automatically generated web.config.

  2. Set the default page of your domain to default.aspx. You can configure it as follow :

a. Click on the Web Directories Icon

b. Click on Directory properties icon

c. Here you can define different properties. To select the default.aspx and index.aspx as first page to load move the pages to the top.

5. Open Visual Studio 2008 and create a new webapplication.

  1. Copy the web.config file over the new web.config file or merge it.
    Following section must be available in the web.config file

`

`

  1. Check if the AJAX and ASP.NET 3.5 assemblies are defined in the assemblies section

`

`

  1. When you drag an AJAX Control on your webpage you will find a line which register the ajax control toolkit on your page. You can define this also in the web.config file so you don't need that line on each asp.net page

In your aspx file you can remove following line:

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

And you can add it into your web.config file as:

`

`

  1. The demo page uses two labels, a button, an updatepanel and a textbox with a date time control extender.

`<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="Demo._Default" %>

<%--<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

`

10. Publishing the project to your subdomain on the Mochahost server.
In our sample the project must be published to demo.mochahost.com/httpdocs/demo
Click on the publish button (right click on the project and click on publish) and test your application on the server.

  1. Result: To prove the AJAX enabled webpage you can see that when you click on the textbox a calendarcontrol will be displayed and when you click on the button
    the label change but the first timestamp will not change.