That is exactly what I'm trying to get the RoutingRule class to do but
without any success.
I tried to use RedirectToAction("404") or RedirectToAction
("generalerror") using Try Catch. I am getting the following error:
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its
dependencies) could have been removed, had its name changed, or is
temporarily unavailable
Here is my class declaration:
public static class RoutingRules
{
public static void Register(IRoutingRuleContainer rules)
{
}
}
thanks
eyal
On Feb 11, 11:07 pm, Ken Egozi <[email protected]> wrote:
> it won't reach the controller since the route won't match.
> this should be dealt like any other 404 error
>
>
>
> On Thu, Feb 12, 2009 at 6:52 AM, eyal <[email protected]> wrote:
>
> > Hi there,
>
> > when defining routing pattern rules you can specify type of parameter
> > as such .Restrict("Id").ValidInteger
> > But what if someone tempers with the url and changes the parameter
> > value to a non integer. How can you handle this?
>
> > For example: mysite.com/productName/12 <- correct url
> > mysite.com/productName/d <- erroneous url
> > mysite.com/productName/ <- erroneous url
>
> > Normally, I trap and handle such errors in a Controller. But now that
> > I'm using routing, such errors for some reason dont even reach the
> > controller.
>
> > thanks
>
> > eyal
>
> --
> Ken
> Egozi.http://www.kenegozi.com/bloghttp://www.delver.comhttp://www.musicglue.comhttp://www.castleproject.orghttp://www.gotfriends.co.il
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---