Skip to main content

Posts

Populate Date DropDown using Javascript

Set the values of Dropdown list of a date:- There are three dropdown lists for each Day, Month And Year.  we fill through javascript with following way:         var date =" 11/23/2010 "; // Format- MM/DD/YYYY         var mm = date.substring(0,2);         var dd = date.substring(3,5);         var yy = date.substring(6,10);                 document.getElementById(" ddlDay ").value=dd;         document.getElementById(" ddlMonth ").value=mm;         document.getElementById(" ddlYear ").value=yy;

Default Button, asp.net

Default Button for a page:                   <form id="form1" runat="server" defaultbutton="buttonName"> < /form > Default Button for a panel:                    < asp:Panel runat = "server" DefaultButton = "lbHello" > < /asp:Panel > Default in a div:-                    < div onkeypress="javascript:return WebForm_FireDefaultButton(event, 'buttonID')" > < /div > For Linkbutton to make a default page, add below javascript at the end of the page <script type="text/javascript">     var __defaultFired = false; function WebForm_FireDefaultButton(event, target) {     var element = event.target || event.srcElement;     if (!__defaultFired && event.keyCode == 13 ...

How to Remove duplicate records - Sql-server 2005

Query to remove duplicate records, in this query please add all the columns in GROUP BY clause that are duplicate, it is based on primary key DELETE from TableName WHERE CoumnName1 + CoumnName2 + CoumnName3 IN (select CoumnName1 + CoumnName2 + CoumnName3         FROM TableName         group by CoumnName1 , CoumnName2 ,CoumnName3         having Count(ID)>1) AND ID NOT IN (select MAX(ID) from TableName         WHERE CoumnName1 + CoumnName2 + CoumnName3         IN (select CoumnName1 + CoumnName2 + CoumnName3                 FROM TableName                 group by CoumnName1 , CoumnName2 ,CoumnName3                 having Count(ID)>1)  ...