Discoverability is a tough nut to crack. When we are writing code, very often we need to create static (shared) methods, and the naming convention of static methods is an important part in helping the discoverability of the method. Do you prefix with Get, Create, Add? The question you tend to ask yourself is "Get [...]
Archive for Programming
How to apply an XSL Transform to a string containing XML data and output the result to a string in memory
I’ve been hit recently with a question: I have a string that holds XML data and I have a stylesheet on disk and I want to apply that stylesheet to that string and get the result in memory. I.e. I do not want to save the output to disk. My first suggestion (the lazy one [...]
Redirected URL for a 401.2 unauthorized access in ASP.NET using Global.asax
Pure Evil. Using custom errors allows us to handle errors and redirect to a proper error page. You can try code like this in your web.config <customErrors defaultRedirect=”"url”" mode=”"On|Off|RemoteOnly”"> <error statusCode=”"404″” redirect=”"error.aspx?errorcode=404″”/> <error statusCode=”"500″” redirect=”"error.aspx?errorcode=500″”/> customErrors> This is used in conjunction the authorization tag in your web.config <authorization> <allow users=”"ARIANNE5\Ash Moollan”" /> [...]