Monthly Archives: May 2008

6 posts

Need to put .vb files and .cs files in App_Code directory, but how?

1. Create a subfolder of App_Code folder named VBCode, and another subfolder named CSCode. 2. Change web.config file as follows: <compilation debug=”false”> <codeSubDirectories> <add directoryName=”VBCode” /> <add directoryName=”CSCode” /> </codeSubDirectories> </compilation> Reference: http://msdn.microsoft.com/en-us/library/t990ks23(vs.80).aspx

How to change the information in browser’s status bar

I came across a question asking how to change browser’s window status information when user moves the mouse over a button on an ASP.NET web page. The solution is to use JavaScript.In the Page_Load event handler, add the following two lines of code: Button1.Attributes.Add(“OnMouseMove”, “javascript:window.status=’Message’;”) Button1.Attributes.Add(“OnMouseOut”, “javascript:window.status=’Done’;) Note, the solution only works in Internet Explorer. FireFox by default disables the ability to change the status bar, because the status bar has been abused by spammers.

Use RegularExpression to enforce strong password

I came across to a post by Anil John talking about how to enforce password complexity by using regular expresion. Here is the regular expression he wrote: ^.*(?=.{10,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).*$ What it enforces is: Must be at least 10 characters Must contain at least one one lower case letter, one upper case letter, one digit and one special character Valid special characters are –   @#$%^&+= This regular expression can be easily used for the RegularExpressValidator control in ASP.NET, and […]

How to stop a malfunctioned web application?

If you are a Windows Server Administrator and notice an ASP.NET web application is malfunctioning, then how will you stop this application? Answer: Just delete the application from the server. Just kidding. 🙂 Real answer: Open up the web.config file of the web application, then change httpRuntime to false. Like this: <system.web> <httpRuntime enabled=”false” /> </system.web> Don’t forget to save the change. The modification of web.config will cause the application to restart, but because httpRuntime […]

Use EventLog to log ASP.NET application errors

For Windows applications, it might be a good idea to use the EventLog to log application errors because the EventLog is very powerful yet very simple to use. However, it might not be a good idea to use it to log ASP.NET web application errors. Why? There are several reasons: It’s all about security. In the malicious cyber world, the security of the web application is a very big concern of any company, if not […]

[Ubuntu]: Still having trouble installing VMWare? Switch to VirtualBox

If you are still having trouble installing VMWare Server 2.0 on your Ubuntu box after following my instructions, then I suggest you to give up VMWare Server and switch to a very nice Open Source software called VirtualBox. Here is the description of VirtualBox from its web site: VirtualBox is a family of powerful x86 virtualization products for enterprise as well as home use. Not only is VirtualBox an extremely feature rich, high performance product […]