Thursday, September 18, 2008

How to disable right click (Context Menu) on object in browser

Example in picture object:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<script language="javascript">
function disableContextMenu(obj) {
obj.oncontextmenu = function() {
return false;
}
}
function onLoad() {
disableContextMenu(document.getElementById("Pic1"));
}
</script>
</head>
<body onload="onLoad()">
<img id="Pic1" src="Pic1.jpg" alt="Picture" />
</body>
</html>

Or use this code:
<img id="Pic1" src="Pic1.jpg" alt="Picture" onmouseover="this.oncontextmenu=function(){return false}" />

Result:


XHTML table or div height in percentage (%)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Height 100%</title>
<style type="text/css">
html {
height:100%;
}
body {
height:100%;
margin:0;
padding:0;
}
</style>
</head>
<body>
<table style="height:100%; width:100%" border="1">
<tr><td>Top</td></tr>
<tr><td>Middle</td></tr>
<tr>
<td valign="bottom">
<table style="height:80px; width:100%" border="1">
<tr><td>bottom</td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>

http://apptools.com/examples/tableheight.php
http://www.webmasterworld.com/forum83/200.htm

How to enable disable Ctrl + Alt + Del before logon XP or Vista

1. Windows + r and type control userpasswords2 (XP, Vista) or netplwiz (Vista only).




2. Goto advance tab on popup window. You can check the checkbox for enable ctrl + alt + del and uncheck the checkbox for disable ctrl + alt + del before logon.

Tuesday, September 16, 2008

Auto delete text on textbox on focus and restore text on unfocus

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title> new document </title>
<meta name="generator" content="" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>

<body>
<input type="text" id="email" value="Your e-mail here" onfocus="if(this.value=='Your e-mail here')this.value=''"
onblur="if(this.value=='')this.value='Your e-mail here'" />
</body>

</html>

Result:

Auto select all text on textbox

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title> new document </title>
<meta name="generator" content="" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>

<body>
<input type="text" id="email" value="Your E-mail here" onfocus="this.select()" />
</body>

</html>

Result:

Command prompts for Windows

http://en.kioskea.net/faq/sujet-403-command-prompts-for-windows

Monday, September 8, 2008

Crystal reports component for server

If you want to run ASP.NET website include crystal reports on web server. The web server will can't run its because server not install crystal report component.

The crystal reports component can found on developer's computer path below

Path:
C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\CrystalReports\


Copy all to install on your server and run your website again.