Posts

Showing posts from February, 2011

Javascript file source path trick for web page in folders

If a master page is used as the master of a page in a sub folder, the javascript file must be referenced as following in the master page <script src="/Scripts/jquery-1.4.1.js" type="text/javascript"></script> If it is referenced as (without the "/" at the befginning of the path, which indicates the relative path to the root) <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script> All pages in the subfolder will not be able to access this javascript file. This style indicates the relative path to the current page. Stylesheet of master page can be indicated as following <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />     

Alternate Style Sheets

This is an good article talking about working with alternate style sheet: http://www.alistapart.com/articles/alternate/ And as a live demo, the following page uses alternate style sheet.  http://www.alistapart.com/d/slidingdoors/final_tabs.html If opened in Fixfox, you can choose View - > Page Style, and then choose different view style for this document.

Detect browser javascript on and off in ASP.Net using c#

The value of Request.Browser.JavaScript indicates whether Javascript is enabled in browser. The above method is depreciated. A better solution is as following (C#):         bool bJavascript = Request.Browser.JavaScript;         System.Version version = Request.Browser.EcmaScriptVersion;         if (version.Major >= 1)         {             bJavascript = true;         }

How to clear MS SQL Server Database log file on GoDaddy

GoDaddy does not allow webmaster to clear the MS SQL Server database log file. And the Database file size is limited to 200 MB. I used to call GoDaddy to truncate the log file. However, it is really time consuming. Using following workflow I can successfully truncate my SQL Server log file. 1. Create a new MS SQL Server DB name it as NDTemplate.  2. Backup this database as an empty database. The backup file is about 1.6MB 3. Backup the original DB that you need to truncate. At my case this backup file is about 200MB. 4. Generate database script for the full database, and execute this sql script against the empty database. 5. Export the data in the Database to the new DB 6. Backup the new DB again and restore it against the original DB. Now the database will have all the data and structure. But the log file is minimized. It will only include the initial insert log.

List of cell phone screen resolution

The following web page contains a list of cell phone screen resolution sorted by brand and model http://cartoonized.net/cellphone-screen-resolution.php

Arvixe server is down again

It is second time the server at Arvixe for my website has problem now. http://forum.arvixe.com/smf/servernetwork-status/poppy-network-issues/ ========== The datacenter that the server poppy is located in has had a network issue affecting a portion of the datacenter. We are working as diligently as possible to identify and resolve the issue as soon as possible. We will continue to monitor and update the customers affected on this server via this post. ========= One clients complains that it has been down for 6 hours already. 

Merge stylesheet and javascript file

The following article is a good start talking about  Combining, Compressing, Minifying ASP.NET ScriptResource and HTML Markups