View Archive

Entries for August 2008

07
Stephen Walther writes an article on creating custom route constraints for web apps. One particularly interesting constraint is to only allow a certain URL to run if it is run from the local machine (which can be great for an admin to check something that others shouldn't be able to). Here's an excerpt: Creating a Local Constraint You also can create a custom constraint that prevents a request from matching a URL unless the request is made from the local machine. This type of constraint can be useful for restricting access to website administrative pages. ... The LocalConstraint simply checks whether the current request is a local request by taking advantage of the Request.IsLocal property. This property returns the value True when the host is either equal to localhost or 127.0.0.1. He goes further by offering suggestions on how to write unit tests for these constraints, illustrating how to fake the HttpContext (look in the download code for this one).

[Read the rest of this article...]

07
I just wanted to make note on my blog of an article by Nathanael Jones about relative paths and whether you use user controls (ascx) or opt to make Control subclasses in App_Code. Overall, it's a nice article, and a good reminder of some subtle differences in the two approaches.

[Read the rest of this article...]

Posted in: Web Apps
);