WorldofASP.NET : ASP.NET Directory, Tutorial, Hosting, and Source Code
You are 1 of 219 users


ASP.NET MVC Tip #30 – Create Custom Route Constraints

Blogger : ASP.NET Team Blogs
All posts : All posts by ASP.NET Team Blogs
Category : ASP.NET
Blogged date : 2008 Aug 07

In this tip, I show how you can create custom route constraints that prevent you from accessing a URL unless you are local and authenticated. I show you how you can create a LocalConstraint and an AuthenticatedConstraint. I also demonstrate how you can test your custom constraints. When you create an MVC route, you can add constraints to a route. For example, the following route maps browser requests to a controller named Blog and an action named Archive: routes.MapRoute( "BlogArchive", "Archive/{entryDate}", new { controller = "Blog", action = "Archive" } ); This route, named BlogArchive, maps three parameters. The controller parameter is assigned the value Blog and the action parameter is assigned the...(read more)

Read comments or post a reply to : ASP.NET MVC Tip #30 – Create Custom Route Constraints
Page 355 of 1924
Next | Last

.NET News Categories








Legend : - Within 3 Days - Within 6 Days - Within 9 Days

Home | Add Resources | Sponsored Listings | Advertise with Us | SiteMap 1 | SiteMap 2 | Link To Us | Contact Us
© 2002-2008 Worldofasp.net ASP.NET Directory, Hosting and Tutorials | All rights reserved
Our Partners : ASP.NET Web Hosting | Windows Web Hosting | ASP.NET Hosting | Phone Card | PHP Directory | Bangkok Hotels |Calling Card