Category JavaScript

GridView Data Print In 2.0

here is the steps: 1) create simple web application (here i used with C#). 2) put following control in to Page. 1) Gridview (id = GridView1) 2) html button (id =Button1) <inputid=”Button1″type=”button”value=”Print”language=”javascript”onclick=”return Button1_onclick()” /> <asp:GridViewID=”GridView1″runat=”server”> </asp:GridView> 3)  fill data into GridView //here i used the list you  can bind with database also System.Collections.Generic.List<string> obj = […]

Disabled Right Click On Web Site

steps : 1) create simple application (html). 2) put the below javascript in to the code. <script language=”JavaScript”> // on right click appear this message var DisplayMsg=”Right Click Disabled”; //return message function clickBYIE() { if(document.all) { alert(DisplayMsg); return false; } } //return message function clickBYNS(e) { if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) { alert(DisplayMsg); return false; […]

Window Resize Using JavaScript

steps : 1) Create the Simple Web Application. 2) in the body written below function for resize the window. <body onload=”Maximize();”> 3) in the JavaScript put the below code. <script language=”javascript”> function Maximize() { //move the window to 0,0 co-ordinate window.moveTo(0,0); //width is the screen width but minus 25 from the height //reson to minus […]

HightLight Error Message In JavaScript

Steps: 1) create simple web application (here i am use the 2.0). 2) In that application put the below code in the designer view. <table> <tr> <td> Enter User Name </td> <td> <asp:TextBoxID=”txtUserName”runat=”server”onblur=”return HighLightErrorMsg(,’lblUserError’,’red’);”></asp:TextBox></td> <td> <divstyle=”visibility: hidden; background-color: Red; width: 200px;”id=”lblUserError”> Please Enter UserName </div> </td> </tr> <tr> <td> Enter Password </td> <td> <asp:TextBoxID=”txtPassword”runat=”server”onblur=”return […]