Posts

Showing posts from November, 2011

Advertisement Slider With Javascript + ASP.Net

There is a inbuilt control name Add Rotator of displaying adds on a page. But it cause postback to displaye next add. So here is a an Add Rotator like code in asp.net and javascript. jaavscript is used ot rotate adds one after another. This is the basic concept and idea. You can do more from this. Content Needed:- Images in the image folder. A script file to rotate the adds and Asp.net coding. script is in the demo download link at the end of the topic. Below is the code:- ASPX Page Code (.aspx) <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %> <!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 runat="server">     <title>Javscript Advertisements</title>     <script type="tex

Install Windows 7 from Flash / Pen Drive

Install Windows 7 From Flash/Pen Drive If you have an image of Windows 7 and your DVD-ROM is not working (mainly in Laptops) then there is only one solution to install Windows 7 is through flash or pen drive. Follow the steps below and be sure that the commands you are using are exactly same as mentioned below. If you type wrong command then you will destroy your Hard Drive. Follow the steps bellow:- 1. Mount the Windows 7 image using virtual drive software. 2. Plug in the pen drive. 3. Open cmd in administrator mode                 Right click on cmd icon and click run as administrator . 4. type DISKPART 5. LIST DISK                 This will list disk drives of the computer. Both your hard disk and pen drive.                 Disk ###                Status                                    Size                         Free                Dyn         Gpt                 Disk  0                  Online                                   407 GB                  1024 KB             

Multiple Default Buttons

Some time we need multiple default buttons in a single form. Like if there are two portion in the from like Login and search or feedback form in single form. Then if you are typing in login part then press and press enter then the Login button is clicked and if in the feedback portion then the button for feedback should be clicked. This can be done by keeping all these portion in a separate panel. Add DefaultButton attribute to panel and give the Id of the button that is inside the Panel. For example Login Button inside Login Panel and Send Buuton in side Feedback Panel. Below is the code. Its not hard but very simple. Code for .aspx Page <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %> <!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

Change Text Color with Javascript

Below is the simple and sweet code of changing text color after fraction of second automatically. Copy n Paste and run... <html> <head> <title>Text Color Change</title> <script type="text/javascript" language="javascript"> elmColor = 0;     function changeColor(elmColor)     {                    switch(elmColor)         {             case 0:             document.getElementById('colorChange').style.color = '#000000';             elmColor++;              break;                          case 1:             document.getElementById('colorChange').style.color = '#ff0000';              elmColor++;             break;                          case 2:             document.getElementById('colorChange').style.color = '#00ff00';              elmColor++;             break;                          case 3:             document.getElementById('colorChange').style

Blinking Text With Javascript

Hello readers. Now the many browsers does not supports the property of blinking text. So here is small and simple script to make the text blink. Code is simple and self explanatory. <html> <head> <title>Blinking Text</title> <script type="text/javascript" language="javascript"> startBlink = 0;     function blinkText(startBlink)     {                  if(startBlink == 1)         {             document.getElementById('blinkMe').style.visibility = 'hidden';             startBlink = 0;                     }         else         {                         document.getElementById('blinkMe').style.visibility = 'visible';              startBlink = 1;           }                                   setTimeout(function(){blinkText(startBlink);}, 700);     } window.onload = function(){blinkText(startBlink);}; </script> </head> <body> <div id="blinkMe&q

Get RGB color code from HEX color code

This Javascript program generate the RGB color code of given HEX color code. Code is simple and understandable. Copy and paste in note pad and save as filename.html and then run. Enter hex code in textbox and click the button. Below is the code:- <html> <head> <title>Hex To Decimal</title> <script type="text/javascript" language="javascript"> function addSeprators(ctrl) {    if(ctrl.value.length == 2)    {         ctrl.value = ctrl.value + "-";    }        if(ctrl.value.length == 5)    {         ctrl.value = ctrl.value + "-";     }        return ctrl.value; } function getRGBCode() {     var hexVal = document.getElementById('hex').value.toUpperCase();        var hexArr = new Array();     var rgbVal = "";       hexArr = hexVal.split('-');       rgbVal = parseInt(hexArr[0],16) +"-"+ parseInt(hexArr[1],16) +"-"+ parseInt(hexArr[2],16); //

Javascript Contnet Slider

Hello readers. This piece of code slides the content just like javascript. Keep in mind about the ID of UL and DIV you are using to slide the content because these ID's are used by the javascript. Below is the code copy n paste and enjoy... <html> <head> <title></title> <script type="text/javascript" language="javascript"> var timerOn = 0; var t = null; v = 0; l = 0; divId = null;     function getItems(idDiv)     {         if(!timerOn)         {             timerOn = 1;             divId = document.getElementById('offers');             divId.innerHTML = "";                        setTimeout(function(){startList(v,l);}, 2000);                               }                 }     function startList(val, len)     {        if(val == len)        {         val = 0;        }                  v = val;         l = len;                var cntnt = "";         var lst =