Error after updating AJAXControlToolkit.dll to version 15 - webforms

Updated the AJAXControlToolkit.dll in an old ASP.NET 4.5.1 WebForms project and am now getting this error:
Extender controls of type 'AjaxControlToolkit.HoverMenuExtender' cannot extend controls of type 'System.Web.UI.HtmlControls.HtmlGenericControl'.
We have an old hover menu extender control in the page that is likely part of the problem:
<ajaxToolkit:HoverMenuExtender ID="pnlCustomerOptE" runat="server" PopupControlID="pnlCustomerAction" PopupPosition="Bottom" TargetControlID="custMenuBtn" PopDelay="200" />
And a div with an image in it that acts like a button on the same page:
<div class="hover-menu-button" id="custMenuBtn" runat="server">Customer
<img src="~/App_Images/nav/arrow-down.gif" id="imgCustMenuArrow" runat="server" width="9" height="8" class="hover-menu-img" alt="" /></div>
Why is this error occuring and how can I fix it? I am running Visual Studio 2015.

You can not fix it until v16.2 will be released: https://github.com/DevExpress/AjaxControlToolkit/issues/3

Related

file '~/controls/labelcontrol.ascx" was not found

I m very new to visual studio and dnn and I m learning the "basics" with a book. I m trying to build my very first module at the moment . In one of the ascx files I have the following code:
<%# Control Language="C#" AutoEventWireup ="true" CodeBehind="Settings.ascx.cs" Inherits="wrox.Modules.guestbook.Settings" %>
<%# Register TagName="label" TagPrefix="dnn" Src="~/controls/labelcontrol.ascx" %>
<fieldset>
<div class="dnnFormItem">
<dnn:Label ID="lblAutoApprove" runat="server" ResourceKey="lblAutoApprove"
ControlName="chkAutoApprove" />
</div>
</fieldset>
<asp:CheckBox runat="server" ID="chkAutoApprove" />
The following piece of code gives the following warning: file '~/controls/labelcontrol.ascx" was not found
<%# Register TagName="label" TagPrefix="dnn" Src="~/controls/labelcontrol.ascx" %>
I need to use the labecontrol.ascx file for this piece of code.
<div class="dnnFormItem">
<dnn:Label ID="lblAutoApprove" runat="server"
ResourceKey="lblAutoApprove"
ControlName="chkAutoApprove" />
</div>
This piece of codes give the following warning because the labecontrol.ascx file is missing (As far as I know):Element 'Label' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing.
I found two simular questions on this site.
The first one wasn't very helpfull because the answer was to ignore the warning. I dont want to do this.
The second question wasn't helpfull either because he/she had a typo.
How can I get rid of this warning?
notes:
I m using visual studio 2017 and dotnetnuke 8
Its been a while since I have done DNN development but the issue is generally that when you are making a custom module, you make it with the context that the rest of DNN is there, but during develop-time, the rest of DNN is not actually there (or at least not where Visual Studio expects to find it).
I would imagine you could get rid of the warning by copying the DNN label control into the controls folder of your module. If you do this, I would make sure your build does NOT include the DNN control and that you put it in whatever ignore list your source control uses.

Adding Kendo UI to an existing MVC 4 project

I have a question about Kendo UI. I have an existing MVC4 project in which I wanted to use some of the Kendo extensions, namely the Editor. Currently the project uses jqWidgets as a UI framework.
I opened VS 2012, loaded the project and used the Telerik menu to add references to Kendo in the project. The wizard added all the necessary references and made changes to the web.config files. So far so good. However, I have two problems:
When I try to use the Kendo Html Helper I do not have intellisense and the Kendo is underlined saying that the HtmlHelper does not have a definition for 'Kendo'. I have <add namespace="Kendo.Mvc.UI" /> in both, my main web.config as well as in the web.config in the Views folder. Strangely enough, when I run the site, I do not get an error, but the editor does not load its initial content and if I try to interract with it, I get the following error: (my second question)
TypeError: invalid 'in' operand e - I am guessing that somewhere in the site, There is a conflict that couses this error, but I cannot find it. Here is how I load all the JS files in my _Layout.cshtml:
#Scripts.Render("~/bundles/jquery")
#Scripts.Render("~/bundles/jqueryui")
#Scripts.Render("~/Scripts/kendo/2013.2.918/kendo.all.min.js")
#Scripts.Render("~/Scripts/kendo/2013.2.918/kendo.aspnetmvc.min.js")
#Scripts.Render("~/Scripts/kendo.modernizr.custom.js")
I am not sure if the problems are related. My jQuery version is 1.9.1 and I am using the latest Kendo version (2013.2.918.340)
Any help would be greatly appreciated.
Here is how I use the editor in the View:
#(Html.Kendo().Editor()
.Name("editor")
.HtmlAttributes(new { style = "width: 700px; height: 400px" })
.Value(#<text>
<p>
Some text
</p>
</text>)
.ImageBrowser(imageBrowser => imageBrowser
.Image("~/Content/UserFiles/Images/{0}")
.Read("Read", "ImageBrowser")
.Create("Create", "ImageBrowser")
.Destroy("Destroy", "ImageBrowser")
.Upload("Upload", "ImageBrowser")
.Thumbnail("Thumbnail", "ImageBrowser"))
)
The solution to the first problem is to add namespace reference only to the web.config file in the Views folder. There is no need to add it to the root web.config. After that restart Visual Studio and reload your project. Everything should be fine and intellisense should work.
As for the second problem, this is hard to guess. Could you show your code where you are loading the contents into HTML editor?

Autocomplete in sharepoint 2010 Visual webpart

I am working on a Visual web part in which I need to list matching data when user type something in text box (like in Google search or Question Title in StackOverflow).
I have ended up in lots of results, but it is for typical c# application. I am looking for a solution which can be implemented directly in my visual web part. I am using SharePoint 2010 and VS 2010.
I did the following things
Installed Ajax Control tool kit.
Added the Items to VS toolbox
and added the following code snippet.
in .ascx file
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
<asp:TextBox ID="txtMovie" runat="server"></asp:TextBox>
<asp:AutoCompleteExtender
ID="AutoCompleteExtender1"
TargetControlID="txtMovie" ServiceMethod="GetCompletionList"
runat="server" UseContextKey="True" />
in .ascx.cs
[System.Web.Script.Services.ScriptMethod()]
[System.Web.Services.WebMethod]
public static string GetCompletionList(string prefixText, int count, string contextKey)
{
return "Hello";
}
But when I deployed I am getting this error
Only one instance of a ScriptManager can be added to the page.
I removed the <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager> from my .ascx file however after that I am not able to edit my sharepint pages because of some js error.
Not sure why it is not working, came across a codeplex feature that will do the trick for you: http://spautocomplete.codeplex.com/
Also, check out this jQuery solution: http://sharepointwings.blogspot.in/2012/05/autocomplete-textbox-using-jquery-in.html
There is also one available from: Microsoft.Office.Search.WebControls.AutoCompleteExtender
regards,
KS

visual studio 2010 - webform design (buttons)

Is there any way to place a row of buttons or link buttons next to each other on a webform without a white space showing between them when viewed in the browser?
thanks again
Well, for starters once you get to the "when viewed in the browser" stage in the process, you're well outside of Visual Studio and into straight HTML/CSS. In HTML/CSS, this can be done:
<input type="button" value="test" /><input type="button" value="test" /><input type="button" value="test" /><input type="button" value="test" /><input type="button" value="test" />
and
input { margin: -1px; }
Using CSS is generally the best way to do this, rather than trying to come up with some custom thing within Visual Studio. It's more native to the target platform, the web browser. The CSS in my example would cover all input elements on the page, of course, so you probably don't want that. But if you can uniquely identify your rendered buttons (perhaps input elements within a div of a known id?) then you can apply that style only to them.

How to enable Javascript IntelliSense for HTML DOM reference support in Visual Studio 2010

If you run my code in Visual studio script block you will find out that VS IntelliSense does not list out options(DOM collection select reference) following the script variable named lb and Dot. Unlike VS, adobe DreamWeaver IntelliSense lists out the DOM properties
Any ideas to change or improve this behavior?
Thanks
<script type="text/ecmascript">
function LookUpStock() {
var lb = document.getElementById("ListBox1");
var product = lb.options[lb.selectedIndex].text;
}
</script>
<form id="form1" runat="server">
<div>
<asp:ListBox ID="ListBox1" Runat="server"></asp:ListBox>
<button type="Button" onclick="LookUpStock()">Look Up Stock</button>
</div>
...</form>
ListBox1 is server-side control. Visual Studio can't figure out how it will look when transformed to HTML.
However, if you write
<select id="ListBox1" />
it will show Intellisense

Resources