Decrease Font Size
Increase Font Size
   BLOG

ASP-NET-4-URL-Routing-Default-Page

by bryian 11. July 2010 18:26

The route URL cannot start with a '/' or '~' character and it cannot contain a '?' character.Parameter name: routeUrl.|

URL Routing with ASP.NET 4 Web Forms|

ASP.NET 4.0 URL Routing Default.aspx page

 

Problem

I was implementing ASP.NET routing features for one of the web application. The code was working correctly in the development environment. Then I deployed it to staging server, navigate to http://mydomain.com/ and received the error
"404 File Not Found".
I tried to include routes.MapPageRoute("Default", "/", "~/Default.aspx"); in the global.asax file but I received another error
"The route URL cannot start with a '/' or '~' character and it cannot contain a '?' character.Parameter name: routeUrl".
After several trials and errors, I found out that we should leave the "URL with parameters" empty. See below.

routes.MapPageRoute("Default", "", "~/Default.aspx");

I hope you all will find this information useful.




The requested content appears to be script and will not be served by the static file handler

by bryian 3. July 2010 11:48

The requested content appears to be script and will not be served by the static file handler.|

An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.|

HTTP Error 500.21 - Internal Server Error |

HTTP Error 404.17 - Not Found

 

Problem

A couple of days ago I was deploying a web application written in VS 2010 to the newly created virtual machine. The virtual machine is running on Microsoft Windows Server 2008. Initially, I received the error message

"The requested content appears to be script and will not be served by the static file handler."

I did some research and found out that I should change the application pool from integrated to classis. I did that, and then I received another error message

"HTTP Error 500.22 - Internal Server Error An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode."

I read some article and someone suggest that we should include this line

<validation validateIntegratedModeConfiguration="false" />

in the web.config file. Run the application and get a different error message,

"HTTP Error 500.21 - Internal Server Error Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list".

I don't remember how I get rid of the error but I received another error message

"HTTP Error 404.17 - Not Found The requested content appears to be script and will not be served by the static file handler."

Finally, I started to realize that the IIS and ASP.NET were not installed correctly. I found the solution to my puzzle on MSDN, the work around is manually registering ASP.NET by running the ASP.NET IIS Registration tool. For more information, see ASP.NET IIS Registration Tool (Aspnet_regiis.exe). I hope you all will find this information useful.

 

Resources

Running Web Applications on Windows Server 2008 with IIS 7.0 and Visual Studio

AjaxControlToolkit is undefined

by bryian 24. February 2010 15:28

'AjaxControlToolkit' is undefined |

'AjaxControlToolkit' is undefined (javascript) |

Microsoft JScript runtime error: 'AjaxControlToolkit' is undefined |

MultiHandleSliderExtender

 

Problem

I have an AJAX MultiHandleSliderExtender Control and ToolkitScriptManager on the web page and everything work fine. Then I decided to include a Master Page to it, at runtime, I received the following errors

Message: Invalid character
Line: 1
Char: 3
Code: 0
URI: http://download.ysatech.com/MultiHandleSliderExtender_w_Chart/default2.aspx?_...
Message: 'AjaxControlToolkit' is undefined
Line: 182
Char: 5
Code: 0

This is a very weird error, the page work fine without the present of a Master Page. I started to look around and found the solution here. The solution is to set the "CombineScripts" property of the ToolkitScriptManager to false.

<ajaxToolkit:ToolkitScriptManager runat="server" ID="ajaxScriptManager" EnablePartialRendering="true" CombineScripts="false" />



Microsoft JScript runtime error: null is null or not an object

by bryian 24. February 2010 14:49

Microsoft JScript runtime error 'null' is null or not an object |

multiHandleSliderTarget.Handle |

MultiHandleSliderExtender | Microsoft JScript runtime error: null is null or not an object

 

Problem

I have an AJAX MultiHandleSliderExtender Control on the web page and everything work fine. Then I decided to include a Master Page to it, at runtime, I received the client-side error "Microsoft JScript runtime error 'null' is null or not an object".
This is a very weird error, the page work fine without the present of a Master Page. I started to look around and found out that the value of the ID and BehaviorID have to be identical. If you happen to come across the same error, give this solution a try. It work for me.

<cc1:MultiHandleSliderExtender ID="MultiHandleSliderExtender1" runat="server" ShowHandleDragStyle="true"
       BehaviorID="MultiHandleSliderExtender1" TargetControlID="txtSlider" Length="500" ShowInnerRail="true"
            EnableMouseWheel="false" OnClientDrag="Drag" Increment="1" OnClientDragStart="DragStart"
            RaiseChangeOnlyOnMouseUp="true" EnableRailClick="false"
            OnClientDragEnd="DragEnd"
            ShowHandleHoverStyle="true" Maximum="222" Minimum="1">
            <MultiHandleSliderTargets>
             <cc1:MultiHandleSliderTarget ControlID="rangeStart" />
                <cc1:MultiHandleSliderTarget ControlID="rangeEnd" />
            </MultiHandleSliderTargets>  
       </cc1:MultiHandleSliderExtender>