Wednesday, May 18, 2011

Print Web Page

 //Copy and Paste this into <body> section
<SCRIPT Language="Javascript">

/*
This script is written by Eric (Webcrawl@usa.net)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/

function printit(){ 
if (window.print) {
    window.print() ; 
} else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = ""; 
}
}
</script>

<SCRIPT Language="Javascript"> 
var NS = (navigator.appName == "Netscape");
var VERSION = parseInt(navigator.appVersion);
if (VERSION > 3) {
    document.write('<form><input type=button value="Print this Page" name="Print" onClick="printit()"></form>');       
}
</script>

Disable Right Click on Web Page

 //insert this script into <BODY> tag or<asp:contentPlaceHolder> tag

<script language=JavaScript>
<!--

//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
// -->
</script>

Monday, May 16, 2011

VB.NET Image SlideShow

 //For 3 images
<head runat="server">
<script type="text/javascript">
var image1=new Image()
image1.src="images/lab/DSC_0024.jpg"
var image2=new Image()
image2.src="images/lab/DSC_0018V.jpg"
var image3=new Image()
</script>
</head>
 //default image
<img alt="" src="~images/class/DSC_0223G.jpg" name="slide" width="333" height="140"/>      
<script type="text/javascript" >
var step=1
function slideit(){
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
if (step<3)
step++
else
step=1
setTimeout("slideit()",2000)     //for 2 seconds
}
slideit()
</script>                         

Sunday, May 15, 2011

Auto Redirect from HTML page to ASPX page in 3 seconds

 <html>
 <body>
<meta http-equiv="refresh" content="3; URL=http://www.mmpsedu.com/default.aspx">
</body>
</html>

Monday, May 9, 2011

VB.NET Vertical Marquee

 //go to source from design then paste this in<td> tag
 <marquee direction="up" onmouseover=this.stop() onmouseout=this.start() scrollDelay="100">
kapiil chaudhary
</marquee>