Getting AJAXToolkit Configured - asp.net

I have searched for days trying to find answers about how to configure AJAX Toolkit to work on my ASP.NET VB.NET site. I am having issues both with my development machine and on my hosing site. I cannot find a good reference on the settings for the web.config file, and the reference in my webpage that will allow the controls to work. Here is as much information that I have and I suspect most of it is wrong. If anyone is actually using AJAXToolkit that comes with Visual Studio 2015 and could provide some guidance I would greatly appreciate it. Here is the information I have.
My Configuration.
* Microsoft Visual Studio 2015 (64bit)
* Hosting with GoDaddy who says they support AJAX but does not say if that is AJAX TOOLKIT.
* ASP.NET AJAX Control Toolkit Version 1.0
* .NET FRAMEWORK 4.1.41102.0
* Development in ASP.NET VB.NET code behind pages.
* AJAX toolkit has been installed on my development workstation version 17.1.0.0
web.config file has not been modified to reference AJAXToolkit as I have not found a good example for this version of AJAXtoolkit.
I have added the following lines to my web.config file in the following areas.
<assemblies>
<add assembly="AjaxControlToolkit, Version=17.1.0.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>
</assemblies>
<controls>
<add tagPrefix="ajaxToolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit, Version=17.1.0.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>
</controls>
On my test page in the header section.
I am actually amazed at how confusing this is. It almost appears that Microsoft has abandoned or never actually adopted AJAX. One would think that simply dropping a component from the Tool Bar into your application should actually work. But I have discovered that is far from the truth.
I have ventured down many different paths to resolve a problem on my site and the AJAX Tools will resolve it if only I can get any one of them to work.
Your help again is greatly appreciated.
Mike

In all my pages I simply have this directive:
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="act" %> and have included AjaxControlToolkit in my project references

Related

How to add another file extension to Razor ViewEngine, e.g. *.html [duplicate]

I manage a large asp.net site which has previously been converted from static html site to asp.net.
For several reasons (mainly SEO) we decided not to rename all the files to .aspx back when we originally converted the site. This was very easy to do by simply adding the buildProvider and httpHandler to the web.config.
<buildProviders>
<add extension=".html" type="System.Web.Compilation.PageBuildProvider"/>
</buildProviders>
<httpHandlers>
<add path="*.html" verb="*" type="System.Web.UI.PageHandlerFactory"/>
</httpHandlers>
Now I am upgrading the site to use Asp.net WebPages with Razor cshtml files. I can rename all the files if necessary, and use url rewriting to make the urls stay the same, however it would be much easier if I could just configure the web.config to tell it to parse .html files as if they were .cshtml.
I have searched around quite a bit, and could not find anything equivalent to the PageHandlerFactory for razor pages. It appears as though it is just an internal mechanism in the .net 4.0 ISAPI handler.
The site is currently running on Windows 2003 server and IIS 6. We will be upgrading to 2008/IIS 7.5 in the near future, but I'd prefer not to wait for that.
Is there any way to get the .html files to be parsed by razor as if they were .cshtml files?
Thank you to SLaks for pointing me in the right direction, but it still took a few hours of digging in the MVC source to figure out the solution.
1 - Need to put RazorBuildProvider in web.config
<buildProviders>
<add extension=".html" type="System.Web.WebPages.Razor.RazorBuildProvider"/>
</buildProviders>
And add System.Web.WebPages.Razor to assemblies if it isn't already there.
<assemblies>
[...]
<add assembly="System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
2 - Add 2 lines in global.asax Application_Start() method
// Requires reference to System.Web.WebPages.Razor
System.Web.Razor.RazorCodeLanguage.Languages.Add(
"html", new CSharpRazorCodeLanguage());
WebPageHttpHandler.RegisterExtension("html");
Call WebPageHttpHandler.RegisterExtension.
You may also need to register a custom WebPageRazorHostFactory to tell the Razor engine what to do with the file; I'm not sure.
As this actually been resolved for use with VS2012 / .net 4.5.
As using the examples above in a C#5 project I get no luck :(

Problem with Rad ajax controls in ASP.net

We have moved asp.net web app from win 2k3 server to win 2k8 R2 server on Amazon EC2. And Previously website is developed in .net 3.5 where we don't see any issues. Now updated to .net 4.0 we are getting problems like
1) Respose.Redirect is not working.
2) dropdownlist usercontrol autopostback is not working.
After searching through various sites. We found that there is a problem with RAD Ajax controls used in the web app. We are using telerik Rad ajax controls in website.
Im able to solve the 1 issue by using RadAjaxManager.Redirect method. But i donot able to solve 2 issue.
In web.config file i see this module version we used
<modules runAllManagedModulesForAllRequests="true">
<add name="RadUploadModule" preCondition="integratedMode" type="Telerik.Web.UI.RadUploadHttpModule, Telerik.Web.UI, Version=2009.3.1310.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"/>
</modules>
Please let me know how to solve these issues.....
and also let me know if you need any information
Your help is very much appreciated.
Thank you

Problem using Ajax with Visual Studio 2010

I am hoping someone can help me. I am trying to add Ajax controls to my VS 2010 project for the first time. I have previously gotten it to work when I used VS2008. I keep getting this exception:
Error 56 The type 'System.Web.UI.ExtenderControl' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Here’s what I did. I downloaded the ajax 4 toolkit and added a reference to the project. I also added a reference to system.web extension to my project. When I do this these lines get added to my web.config
<assemblies>
<add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies></compilation>
I added these lines to my aspx file.
<%# Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
And
<cc1:CalendarExtender runat="server" Id="txtDateOfBirth_CalendarExtender" TargetControlID="txtDateOfBirth"></cc1:CalendarExtender>
Etc.
I also backed off and tried ajax 3.5, this didn’t help. I did notice that the ajax dll is 4.1 while the 'System.Web.Extensions is 4.0. I don’t know if this matters but I cannot find ajax 4.0 or 'System.Web.Extensions 4.1.
Thank once again in advance.
This is not a solution but a recommendation: stay away from the Ajax toolkit or you are asking for trouble; use jquery instead (seriously, I have been down this road).

VB webform in IronPython asp.net website

I tried to bring a previously done webform made in vb.net to an IronPython asp.net website with no luck. After seeing it didnt work, I tried to write the simplest codebehind vb.net webform to see if there was a problem with vb.net in an IronPython website and I got the following usual error
"be sure that the defined class in this file matchs with the one in the attribute inherits and that it extends the right base page (page or control)" (sorry if the translation isnt the most accurate I get that message in spanish)
but if I create a vb.net webform in the same website, with the sourcecode in the same file (with the vb.net code between script runat="server" tags in the same page) I get no problem.
Do I have to configure something for both kind of sourcecode languages to run in such way in the same IronPython website, like configuring something in the webconfig file or is there some compatibility issue for doing that which can't be resolved?
The code between <script /> tags is compiled dynamically when the page is first run. This enables you to mix languages. However, the classes in your code-behind files are statically compiled into an assembly by VS.NET ... and a VS.NET project can only support one language at a time.
One solution is to put your VB.NET code-behinds in a separate assembly. For example:
Add a new VB Class Library project to your existing solution
Add a reference to System.Web
Create your VB.NET code-behinds. They should be normal classes inheriting from System.Web.UI.Page.
In your ASP.NET website project, add a reference to the new project
Edit the # Page directives in your *.aspx files to inherit the classes in the new project
e.g. <%# Page Inherits="YourNewVBClassLibraryProject.MyVBCodeBehinds" ... /> where the Inherits attribute contains the relevant namespace-qualified class name
Thanks for the reply Serilla. Your information was interesting but I simply solved it by creating the app_folder and adding the vb files there. Do you think I could have some future problem for doing so?
The problem with the vb files was when these lines in the web.config were enabled for Ironpython to work
<pages compilationMode="Auto" pageParserFilterType="Microsoft.Web.Scripting.UI.NoCompileCodePageParserFilter" pageBaseType="Microsoft.Web.Scripting.UI.ScriptPage" userControlBaseType="Microsoft.Web.Scripting.UI.ScriptUserControl">
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>
</pages>
when I removed them, vb code behind files worked but ironpython didnt. When the lines were there, Ironpython code behind files worked but vb ones didnt

How to fix the HTML Intellisense in ASP.NET AJAX Controls or Pages

I'm using ASP.NET AJAX. I create a .aspx page that is based on a .master file. I add the , , control into the content page, and suddenly the markup intellisense no longer works for these controls, or for any controls nested within them.
Is this a bug? Can I fix this?
The fix for the intellisense issue will be in VS 2005 SP1.
In the meantime there are two workarounds that you can use to fix it immediately:
1) Keep the .master file open within the Visual Studio IDE when working on the .aspx content page. It turns out the intellisense engine only runs into issues if the .master file is closed. As long as it is open within the same IDE, it resolves the assemblies just fine and will give you full intellisense
2) Go into your web.config file and change the tag-prefix naming for the ASP.NET AJAX controls to something other than . For example, instead of:
<controls>
<add tagPrefix="asp" namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Extensions" />
<add tagPrefix="asp" namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Extensions" />
</controls>
change them to something like this:
<controls>
<add tagPrefix="ajax" namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Extensions" />
<add tagPrefix="ajax" namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Extensions" />
</controls>
You'd then want to update your tag prefixes in your .aspx page to use this new tag prefix.
Either of these approaches will solve the problem and deliver full intellisense. The issue should then be resolved completely with VS 2005 SP1.

Resources