ToolkitScriptManager is not a known element - asp.net

I have a website in which I am using the AJAX Accordion Pane. In order to fully use the RequireOpenedPane="False" I need to have the ToolkitScriptManager added to the site.
I understand all of this but there's an issue. Visual Studio 2012 says the ToolkitScriptManager is not a known element
I have
<add tagPrefix="asp" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
in the web.config file, and
<asp:Accordion ID="Accordion1" runat="server" CssClass="accordion" SelectedIndex="-1" HeaderCssClass="accordionHeader" HeaderSelectedCssClass="accordionHeaderSelected" ContentCssClass="accordionContent" RequireOpenedPane="False" FramesPerSecond="25" Width="820px" >
works with no errors. But
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
does not.
Here's the funny thing, if I remove the ToolkitScriptManager from the page, it'll load the Accordion, however, not all functionality will be working (for example, clicking an accordion header does not select the header, it just expands the header, but does not show as "Selected").
The page DOES have a MasterPage as well, the ToolkitScriptManager is inside the ContentPlaceHolder for the body. (it's actually right above the Accordion control). Why is this doing this, and how can I fix it?
<%# Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="page.aspx.cs" Inherits="page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeaderContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MenuContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
<h1 align="center">Classes</h1>
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
<asp:Accordion ID="Accordion1" runat="server" CssClass="accordion" SelectedIndex="-1" HeaderCssClass="accordionHeader" HeaderSelectedCssClass="accordionHeaderSelected" ContentCssClass="accordionContent" RequireOpenedPane="False" FramesPerSecond="25" Width="820px" >
<Panes>
<asp:AccordionPane runat="server" ID="AccordionPane0">`

Found solution:
Apparently the AjaxControlToolkit obtained from using the NuGet installer on Visual Studio 2010 does NOT have the ToolkitScriptManager. I had to remove the DLL installed from NuGet and install my own DLL which did include the ToolkitScriptManager.
I'm not sure why the NuGet version does not contain the ToolkitScriptManager.

On top of your solution user1760784, others may ALSO need to setup IIS first and import their app in. Once the app is fully setup in IIS then try to run it. It should work. With this process done my issue was resolved.
Please note this is true for both test IIS and live/production IIS. Although as we all know it's always safer to test off live boxes.
Why does it only resolve when testing on IIS?
I don't really know. However I believe it could because of http/browser issues. Maybe you smarter folks can let us know on this point.
Enjoy!

Related

DX DateEdit controls break inside of an ACT Accordion control

I've got several DevExpress DateEdit controls on my page organized into an AjaxControlToolkit Accordion along with other fields relevant to my data.
The DateEdit controls worked quite fine until I put them into the Accordion so I'm assuming the problem is some conflict between DevExpress and AjaxControlToolkit though I have no other alternative unless there's a DX accordion type control that does the same as the one from the Control Toolkit...
The error I'm getting in my browser when I try to use a date editor is
ASPx is not defined
No other details that I could find but DateEdit fields placed outside of the Accordion work perfectly.
Note that removing the accordion is not a viable solution for this project without a possible alternative being presented.
Here's my code:
<%# Register TagPrefix="ajax" Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" %>
<%# Register Assembly="DevExpress.Web.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphContent" runat="server">
<asp:UpdatePanel runat="server" ID="upAlerts">
<ContentTemplate>
<ajax:Accordion runat="server" ID="Accordion1" EnableViewState="true" CssClass="panel panel-info"
HeaderCssClass="panel-heading" ContentCssClass="panel-body">
<Panes>
<ajax:AccordionPane runat="server" ID="apAlert">
<Header>
<h3>Alert Details</h3>
</Header>
<Content>
<div class="form-group">
<label for="dtDate">Date</label>
<dx:ASPxDateEdit ID="dtDate" runat="server" DisplayFormatString="yyyy/MM/dd" CssClass="form-control"></dx:ASPxDateEdit>
</div>
</Content>
</ajax:AccordionPane>
</Panes>
</ajax:Accordion>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
​I would normally suspect the problem to actually exist with the ViewState since I know these controls (ACT ones in particular) can mess with the ViewState quite a lot, but the Accordion isn't currently disabling the ViewState so I'm prepared to rule that out as a possibility at this point.
That said, I'm all out of ideas.
I even tried to rearrange the order in which the assemblies are registered on the page so that DevExpress is being registered after Ajax in an attempt to ensure that Ajax wasn't overriding anything that DevExpress needed.
As a last resort I tried switching the DevExpress date editors to Ajax calendar extenders but for some weird reason they don't render correctly either (no dates are visible on the calendar pop out).
How can I get these DateEdit controls working?

ASP.NET Ajax Accordion Control not working properly with ScriptManager

I've been reading SO for a while now, but that's the first time I post a question (first time I don't find the answer of what I'm looking for)
Here is my setup:
Master page:
<%# Master Language="C#" AutoEventWireup="true" CodeBehind="Master.master.cs" Inherits="VatechWebsite.Master" %>
<html>
<head>...</head>
<body>
<form>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
...
<asp:ContentPlaceHolder ID="content" runat="server">
</asp:ContentPlaceHolder>
</form>
</body>
</html>
Content page:
<%# Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="Brand.aspx.cs" Inherits="VatechWebsite.Brand1" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
<asp:Accordion ID="CategoriesAccordion" runat="server" HeaderCssClass="AccordionHeader">
<HeaderTemplate><%# DataBinder.Eval(Container.DataItem, "CategoryName") %></HeaderTemplate>
<ContentTemplate>
<div id="ProductList">Some text<br />supposed to be very large <br/></div>
</ContentTemplate>
</asp:Accordion>
<asp:Content/>
When I run this page, the accordion displays correctly, binds data correctly, and has the first pane expanded. The problem is, I cannot expand/collapse a pane. It seems that the javascript associated with this control is not running correctly. If I replace ScriptManager in the master page with a ToolkitScriptManager, the problem is solved; but I don't want to do that because I have other pages that need the ScriptManager.
I read that the ScriptManager should be adequate for running asp ajax controls, so why is it not working in this case?
If you're stuck with one ScriptManager for some pages, and ToolKitScriptManager for another, there are ways to use the same master page on all your pages, and use different ScriptManager on different pages.
This answer details a few approaches, one approach will disable Master.ShowScriptManager = false; on PageLoad.
Disable ScriptManager on certain pages
Another suggests having different ScriptManagers on for different ContentPlaceHolders, which also works.
Hope this helps!

TextBoxWatermarkExtender

i am new to asp.net and i was to work in AjaxControlToolkit and i instaled and performed other operation but it is showing me report...,
error is:
The type name 'TextBoxWatermarkExtender' does not exist in the type 'AjaxControlToolkit'
protected global::AjaxControlToolkit.TextBoxWatermarkExtender TextBoxWatermarkExtender1;
code is:
<asp:TextBoxWatermarkExtender id="TBWEDOB" runat="server" targetcontrolid="txtDOB"
watermarktext="dd/mm/yy" watermarkcssclass="watermarked"> </asp:TextBoxWatermarkExtender>
plz any one pelp me on this flow....,
First Check This
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
in Your Page and see what is the TagPrefix in your page and than use that.like
<asp:TextBoxWatermarkExtender ID="TBWE2" runat="server"
TargetControlID="TextBox1"
WatermarkText="Type First Name Here"
WatermarkCssClass="watermarked" />
it will work defiantly
Why don't you simply try placeholder property to achieve the watermark in input fields.
Yes, There is a restriction of older browser, so if you are working with newer version (suppots HTML 5) then you can use it like this
<asp:TextBox ID="textbox1" runat="server" placeholder="dd/mm/yyyy"></asp:TextBox>
You haven't provided much information so it will be tough to identify where your mistake is, here's a simple step-by-step list of how you can use AJAX in your application, just follow the points below and it will work:
1) Download AJAX from codeplex, save and unzip anywhere on your machine
2) In Visual Studio Toolbox, Right click-> Add Tab, give it a name
3) Right click the newly created tab -> Choose Items...
4) Click Browse, find AjaxControlToolkit.dll and click OK
5) If all is well the controls will be added to your toolbox
6) Drag and drop a ToolkitScriptManager to the .aspx page, doing this will automatically:
6.1) Add a AjaxControlToolkit.dll reference to your project
6.2) Add the following line to the source view of your page
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
7)Drag and drop a TextBoxWatermarkExtender to the .aspx page and you're done:
<asp:ToolkitScriptManager ID="sm" runat="server" />
<asp:TextBoxWatermarkExtender ID="watermark" runat="server" TargetControlID="txtName" WatermarkText="Type name here..." />
<asp:TextBox ID="txtName" runat="server" />
try modifying the tag prefix
on the top of the page register the ajax tool kit.
<%# Register Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" TagPrefix="ajax" %>
<ajax:TextBoxWatermarkExtender id="TBWEDOB" runat="server" targetcontrolid="txtDOB"
watermarktext="dd/mm/yy" watermarkcssclass="watermarked"> </ajax:TextBoxWatermarkExtender>

ASP Ajax control toolkit calender extender not displayed properly

ASP Ajax control toolkit Calender extender is not appearing properly. Only text values are appearing and looks like CSS is not applied. I tried to disable all the CSS definitions for the page but still it is not being displayed properly.
<%# Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
CodeBehind="DataDownload.aspx.cs" Inherits="myapp.DataDownload" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="head_content" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="body_content" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<asp:TextBox ID="txtFromDate" CssClass="inp-form" runat="server"></asp:TextBox>
<asp:CalendarExtender ID="calFromDate" runat="server" TargetControlID="txtFromDate" >
</asp:CalendarExtender>
</asp:Content>
Try commenting Existing Js files on page.
reason : simple, As we know ajax on [page load complete] method makes javascript Code on the fly , which conflicts with existing javascript/jquery on the page, which results on malfunction of either functionality.

problem with html editor

I used Html Editor with firefox on my pc. I switched pcs and I tested my site again.. The HTML editor appears completely messed up across browsers ..It doesnt even look as good as it
is on the original pc i deployed it.
The question is why? And should I use ajax at all instead of jquery?
All the pages markup:
<%# Page Title="" Language="C#" MasterPageFile="~/YourGuruMaster.master" AutoEventWireup="true" CodeFile="PostEdit.aspx.cs" Inherits="PostEdit" %>
<%# Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit.HTMLEditor" tagprefix="cc1" %>
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
<asp:PlaceHolder ID="PlaceHolder2" runat="server"></asp:PlaceHolder>
<cc1:Editor
ID="Editor1"
Width="850px"
Height="400px"
runat="server"/>
<br />
<asp:Button
id="btnSubmit"
Text="Submit"
Runat="server" onclick="btnSubmit_Click" />
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="Editor1" ErrorMessage="אין להשאיר שדות רקים"
ForeColor="#CC0000"></asp:RequiredFieldValidator>
1.) This is a much deeper problem. You probably need to add more rules to your css stylesheet. If you want the site to look the same across different browsers, you have to look into cross browser support and cross browser compatibility.
2.) The jQuery library has a full suite of AJAX capabilities. There is no need to use self-made js functions to create AJAX calls. Stick with jQuery.

Resources