Creating your own custom classes for business objects and object datasources is a great way to provide and object model for databases. But some classes might contain properties that you don’t expect to show to end users when they are bound to a DataGrid, FormView or other databound control. Luckily there is an attribute that […]
You are browsing archives for
Category: .NET Programming
ASP.Net – Server operation is not available in this context – Using Server.MapPath in Global.asax
If you try to use the Server.MapPath() function in your global.asax file for ASP.Net you are likely to encounter this error: Server operation is not available in this context To use Server.MapPath() in global.asax instead use: System.Web.Hosting.HostingEnvironment.MapPath() More details about System.Web.Hosting.HostingEnvironment.MapPath() are available on MSDN
ASP.Net Tools to Test High CPU Load, High Memory and High Disk Usage
Often when testing the performance of a ASP.Net website you need to see how the site will perform under extreme conditions. This is easy to do in a virtual environment where you can reduce the number of CPUs or available RAM. But how do you test this on a physical box? Vijayshinva Karnure has written […]
Keeping Exception.StackTrace Intact when Rethrowing an Exception
Nick Weinholt (.Net Performance guru and MVP) has an article on the correct method for rethrowing an exception in C# so that the Exception.StackTrace actually points to the root problem. In C# the correct method for rethowing an exception is using throw; without any arguments within the catch block: try { // code } catch […]