I'm new to the AjaxControlToolkit and I'm having trouble getting started. I installed the ACT from NuGet into my VWD 2010 Express project. I then added the ToolkitScriptManager, and the SlideShowExtender to one of the pages in the project.
This is the code, the code-behind and a portion of the web.config:
<%@ Page Title="Smilemakers" Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPages/1colSideBar.master"
CodeBehind="Smilemakers.aspx.vb" Inherits="Toys2.Smilemakers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Main" runat="server">
<h3>
SmileMaker Gallery</h3>
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="Server" />
<asp:Label ID="lblTitle" runat="server" Text="Label"></asp:Label><br />
<asp:Image ID="Image1" runat="server" ImageUrl="Pictures/100_2228.jpg" Height="340px" />
<ajaxToolkit:SlideShowExtender ID="SlideShowExtender1" TargetControlID="Image1" AutoPlay="true"
NextButtonID="btnNext" PreviousButtonID="btnPrev" PlayButtonID="btnPlay" PlayButtonText="Play"
StopButtonText="Stop" runat="server" Loop="true" ImageTitleLabelID="lblTitle"
SlideShowServiceMethod="GetPhotos" BehaviorID="SlideShowBehavior" />
<br />
<asp:Button ID="btnNext" runat="server" Text="Prev" />
<asp:Button ID="btnPlay" runat="server" Text="Stop"/>
<asp:Button ID="btnPrev" runat="server" Text="Next" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="SidBar" runat="server">
<p>
a method to filter pictures.</p>
</asp:Content>
*** Code Behind ***
Public Class Smilemakers
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
GetPhotos()
End Sub
<System.Web.Services.WebMethod()> _
<System.Web.Script.Services.ScriptMethod()> _
Public Shared Function GetPhotos() As AjaxControlToolkit.Slide()
Dim photos(3) As AjaxControlToolkit.Slide
photos(0) = New AjaxControlToolkit.Slide("Pictures/100_2228.jpg", "Title1", "")
photos(1) = New AjaxControlToolkit.Slide("Pictures/100_2243.jpg", "Title2", "")
photos(2) = New AjaxControlToolkit.Slide("Pictures/100_2275.jpg", "Title3", "")
Return photos
End Function
End Class
*** web.config ***
<system.web>
.....
<pages>
<controls>
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"/>
</controls>
</pages>
</system.web>
Intellesense underlines 'ToolkitScriptManager' in the statement <asp:ToolkitScriptManagerID="ToolkitScriptManager1"runat="Server"/>
and says "Element 'Tookkit Script Manager' is not a known element" Can you tell me where I'm going astray? your assistance will be greatly appreciated.
When I made your suggested change to the web.config file I got an error. I confess, the web.config file is a complete mystery to me. When NuGet installed the AjaxControlToolkit it added the <pages><controls> elements to the web.config
file and set tagPrefix="ajaxToolkit," not "asp." I also noticed two anomalies. First, the code for the toolkitScriptManager magically became <ajaxToolkit:ToolkitScriptManagerrunat="server"/>
The second anomaly was that the Slideshow Extender interface did not operate properly. When I clicked the Stop button the slide show stopped, but two clicks of the Next button were required to advance the slide.
Changing the Tagprefix to ajaxToolkit seemed to resolve these issues. Thanks again.
Member
92 Points
365 Posts
Error: Element 'Tookkit Script Manager' is not a known element
Nov 19, 2011 03:52 PM|GrandpaB|LINK
I'm new to the AjaxControlToolkit and I'm having trouble getting started. I installed the ACT from NuGet into my VWD 2010 Express project. I then added the ToolkitScriptManager, and the SlideShowExtender to one of the pages in the project.
This is the code, the code-behind and a portion of the web.config:
Intellesense underlines 'ToolkitScriptManager' in the statement <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="Server"/> and says "Element 'Tookkit Script Manager' is not a known element" Can you tell me where I'm going astray? your assistance will be greatly appreciated.
Member
690 Points
150 Posts
Re: Error: Element 'Tookkit Script Manager' is not a known element
Nov 19, 2011 09:19 PM|maroasp.net|LINK
hi,
1- in your master page you need to register the toolkitscriptmanager if you didn't
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
2- in your web.config is A better approach would be to register the assembly/namespace/tag prefix inside your web.config, like so:
<configuration>
<!-- ... -->
<system.web>
<!-- ... -->
<pages>
<controls>
<add tagPrefix="asp"
namespace="AjaxControlToolkit"
assembly="AjaxControlToolkit" />
</controls>
</pages>
</system.web>
</configuration>
Good Luck
Member
92 Points
365 Posts
Re: Error: Element 'Tookkit Script Manager' is not a known element
Nov 20, 2011 12:16 PM|GrandpaB|LINK
Maroasp.
Thanks for your reply; registering the AjaxControlToolkit in the Master page solved the problem. However, I did make a change; it is registered as:
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
When I made your suggested change to the web.config file I got an error. I confess, the web.config file is a complete mystery to me. When NuGet installed the AjaxControlToolkit it added the <pages><controls> elements to the web.config file and set tagPrefix="ajaxToolkit," not "asp." I also noticed two anomalies. First, the code for the toolkitScriptManager magically became <ajaxToolkit:ToolkitScriptManager runat="server"/> The second anomaly was that the Slideshow Extender interface did not operate properly. When I clicked the Stop button the slide show stopped, but two clicks of the Next button were required to advance the slide.
Changing the Tagprefix to ajaxToolkit seemed to resolve these issues. Thanks again.