Problem with Rad ajax controls in ASP.net - 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

Related

Asp.Net httphandler cause 500 (Internal server error)

I want to add a handler to my existing web form application.
Following this walkthrough in web.config I've added:
<configuration>
<system.web>
<httpHandlers>
<add verb="post" path="redirect.ashx" type="RedirectHandler"/>
</httpHandlers>
</system.web>
</configuration>
I've created a Generic Handler (called RedirectHandler.ashx) in App_Code folder,
but when I run the application (VS2017) it causes a 500.
The tutorial makes a distinction between registering in IIS 6.0 and IIS 7.0. I'm not sure which one applies to me considering that VS runs IIS Express 10.0. Anyway, I've already tried both with poor results.
I'm a noobie to web forms but it seems pretty straightforward. I don't understand why it doesn't work.
EDIT: Creating a new project and adding httphandlers doesn't cause any issue. So it must be some configuration with my current project but I have no idea what may cause the error.
EDIT 2: To answer at the 500 error, the problem was caused by the wrong "type" in httpHandlers. Type should be "Namespace.class".
This post really helped me to figure out a few things.

Getting AJAXToolkit Configured

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

ASP.NET 4.5.2 MVC5 web api controller returning 404 on production server

I have an issue where my web api that works fine on my development machine is returning 404s for all routes when installed on the production server. The production server is running Windows 2008 (not R2) if this matters.
I've confirmed the correct framework is installed on said server (project is targeting 4.5.2)
I've tried the most suggested solution of adding:
<modules runAllManagedModulesForAllRequests="true" /> to <system.webServer>
but this does not work at all.
I also tried the other suggestion of adding the following instead of RAMMFAR:
<modules>
<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
</modules>
But this also doesn't seem to work at all.
Any ideas what the issue here might be or other things I can try?
Possibly irrelevant but perhaps related:
One odd thing I found while looking into the UrlRoutingModule is that if I open server level in IIS Manager and view modules, it is listed in there, but if I try to change the "invoke only for requests to ASP.NET applications..." checkbox I get the following error, which almost seems to suggest it's not installed properly or something? I tried a repair of the .net framework 4.5.2 on this basis but no luck with that either.

ASP.NET Charting Control only working on some servers

Yesterday we pushed out some changes including the addition of ASP.NET MVC 3 (routing, configuration, etc.) and our ASP.NET charting controls stopped working. In our development environment the ASP.NET chart control works as expected. However in our test and production env. we are getting errors from the DefaultControllerFactory as no path can be found for the axd url - "Pages/Secured/ChartImg.axd"
We've tried comparing any differences with the IIS configuration and web.config and made sure the system.webserver node has the correct handler as so...
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
This has not helped and we are not sure what else could be wrong. It appears to be the chart handler is not setup correctly, but we have no way of knowing why.
Any help would be greatly appreciated.
It turns out we had a compiler directive on the user control that switched the ImageStorageMode property of the charting control based on debug/release builds. This explained why it was only working on our dev environments that got a debug build and not the other environments. After discovering that we used the fix from this question ASP.NET Charting Control no longer working with .NET 4, which fixed the routing issue we had for the handler when the ImageStorageMode was set to UseHttpHandler.

Ajax client-side framework failed to load Asp.Net 4.0

I got a complicated problem with ASP.Net 4.0 Ajax....I started a website with Visual Studio 2010 on my machine,and added some update panels they used to work fine,but suddenly i got that series of errors when i run my website
Microsoft JScript runtime error: ASP.NET Ajax client-side framework failed to load.
Microsoft JScript runtime error: 'Sys' is undefined
The strange things is that i made a website on the same machine with VS 2010 and the update panels there work perfectly.i took its web.config to my new website and changed just the connection..and i got the same error
I tried to search for a solution but i failed to find any real solution.Can anyone help?
Here is the answer by zhughes from this thread on asp.net forum.
The Reason : the path of the javascript generated by the scriptmanager changes when the URL Routing module is used.
The Solution : Tell the routing API to not route the files with "axd" extension (the files generated by the scriptmanager)
Add this rule to the method where you register the routing rules in Global.asax
routes.Ignore("{resource}.axd/{*pathInfo}");
in addition you should have this section in web.config
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
if you using URL rewrite module, then in each rewrite rule add
<add input="{URL}" pattern="\.axd$" negate="true"/>
under conditions tag, like this:
<rule name="HomeRewrite" stopProcessing="true">
<match url="^home$"/>
<conditions>
<add input="{URL}" pattern="\.axd$" negate="true"/>
</conditions>
<action type="Rewrite" url="/home.aspx"/>
</rule>
I have found that this is a possibly a caching/compression issue and by putting in the following into Web.Config, resolves the issue.
<system.web.extensions>
<scripting>
<scriptResourceHandler enableCaching="false" enableCompression="false" />
</scripting>
</system.web.extensions>
I was having the same problem. I installed VS 2010 SP1 and the problem went away.
I had the same problem and I solved it by run the command aspnet_regiis -i on the folder of the Framework 4.0 (on which my application ran). It was a problem on the Handler Mapping of IIS: this operation fix the problem for me.
See also this post.
Hope this could be helpful.
It may be simply missing part in your web.config like the <Handlers> of <httpHandlers>, my advice is if you have old copy of your web config try it out.
Microsoft JScript runtime error: ASP.NET Ajax client-side framework failed to load.
Add reference like this..
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Services, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Services.Client, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
This is a common error that happens when you try to call framework javascript function before page have even loaded them.
So ether run your code when dom is ready (eg pageload), ether place your code after the scriptmanager tag, or check to place it after the javascript load from scriptmanager.
I had this problem and sought an answer from the almighty Google, tried various suggestions including the ones above but had no luck. Gave up and moved on to other work, came back a few days later and the problem had disappeared.
I resumed work, made some code changes and published my website and the problem reappeared. Went back to the Google and came across someone who had the problem while using the 3.5 framework. In that case s/he was able to resolve the problem by going to the 'Add/Remove Programs' control panel and selecting the repair option.
I did likewise, repairing the 'MS .NET Framework 4 Client Profile' and 'MS .NET Framework 4 Extended'. That fixed the problem for me.
Hope that solves it for someone else.
in my case, it's IISExpress, switch back to the cassini dev server fix my headache.
I had this problem as well dealing with a master page and in my case it was a "Base" meta setting that was messing me up. I do recall reading another article/blog somewhere where they mentioned an issue with ajax validation across different domains causing this type of error.
So in my case, I had a <base...> reference setting the default url for the site but my dev was obviously a different url...thus conflict and the "ASP.NET Ajax client-side framework failed to load." error.
Removed the base and voila...error gone.
HTH
Dave
If .Net Framework 4.0 client Profile is not available in your machine , so repair .net Frame work 4.0 or re install .
go to Project Property and select target framework 3.5.
In my case it was the UrlScan tool by Microsoft that was rejecting some URL's requested by Ajax. Disabling it solved the problem.

Resources