Submit a Ticket
Support Center » Knowledgebase » AJAX Control Toolkit

AJAX Control Toolkit

Howto publish an AJAX enabled, with the AJAXControltoolkit, web application with Visual Studio 2008 on your Mochahost hosting server.

 

1.       Prerequisites :

Visual Studio 2008

.NET Framework 3.5 sp1

ASP.NET 3.5

AjaxControlToolkit

2.       AjaxControltoolkit.
The Ajaxcontroltoolkit is located at :
http://ajaxcontroltoolkit.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=16488
The walkthrough can be found here: http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/

In this manual we will setup a new subdomain called demo.pureautomation.be and we will publish an ajax enabled webapplication with visual studio 2008. The webapplication uses the AJAXcontrol 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


e.     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




2.      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.
I am not sure if the web.config file will be changed if you change the ASP.NET version afterwards !
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




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

4.      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.




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

  <configSections>

    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup,
               System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35
">

      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup,
               System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35
">

        <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection,
               System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35
"

              
requirePermission="false" allowDefinition="MachineToApplication"/>

        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup,
               System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35
">

          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection,
               System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35
"

              
requirePermission="false" allowDefinition="Everywhere" />

          <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection,
               System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35
"

              
requirePermission="false" allowDefinition="MachineToApplication" />

          <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection,
               System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35
"

              
requirePermission="false" allowDefinition="MachineToApplication" />

          <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection,
               System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35
"

              
requirePermission="false" allowDefinition="MachineToApplication" />

 </sectionGroup>

      </sectionGroup>

    </sectionGroup>

  </configSections>

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

     <assemblies>

        <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />

        <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

        <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />

        <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />

        <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />

        <add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

        <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />

      </assemblies>

8.      When you drag an AJAXControl on your webpage you will find a line which register the ajaxcontroltoolkit 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 :
<controls
>
      <
add tagPrefix="asp" namespace="System.Web.UI" assembly="
System.Web.Extensions,
            Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35
"/>

           <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions,
                  Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35
"/>

 <add tagPrefix="AjaxToolkit" namespace="AjaxControlToolkit" 
        
assembly="
AjaxControlToolkit, Version=3.0.20820.16598,
         Culture=neutral, PublicKeyToken=28F01B0E84B6D53E
" />

 </controls>


      </assemblies>

9.      The demo page uses two labels, a button, an updatepanel and a textbox with a datetimecontrolextender.

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

 

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

--%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title></title>

</head>

<body>

    <form id="form1" runat="server">

    <div>

        <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>

        <asp:ScriptManager ID="ScriptManager1" runat="server">

        </asp:ScriptManager>

        <asp:UpdatePanel ID="UpdatePanel1" runat="server">

            <ContentTemplate>

                <asp:Button ID="Button1" runat="server" Text="Button" />

                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

                <AjaxToolkit:CalendarExtender ID="TextBox1_CalendarExtender" runat="server" Enabled="True"

                    TargetControlID="TextBox1">

                </AjaxToolkit:CalendarExtender>

                <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

            </ContentTemplate>

        </asp:UpdatePanel>

    </div>

    </form>

</body>

</html>

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.



11.   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. The demo is available at: http://demo.starwars.my-hosting-panel.com







 This answer was helpful  This answer was not helpful
 Back