Tuesday, December 27, 2011

IIS settings –for enabling .net compilation


Open command prompt as run as administrator mode

Go to the .net framework folder
Ex:-Type cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319 (this is for 64bit machine too)

Run the following command

aspnet_regiis -i -enable

Thursday, December 22, 2011

Standard file upload control for all browser


<html>
<head>
<style type="text/css">
div.fileinputs {
       position: relative;
}

div.fakefile {
       position: absolute;
       top: 0px;
       left: 0px;
       z-index: 1;
}

input.file {
       position: relative;
       text-align: right;
       -moz-opacity:0 ;
       filter:alpha(opacity: 0);
       opacity: 0;
       z-index: 2;
}
</style>
</head>
<body>
<div class="fileinputs">
       <input type="file" class="file" />
       <div class="fakefile">
              <input />
              <img src="search.gif" />
       </div>
</div>
</body>
</html>

Readonly Textbox with backspace restricted


Instead of using following code

   <asp:TextBox ID="txt_to" runat="server" Width="85px" ReadOnly="true"></asp:TextBox>

Use this code
   
<asp:TextBox ID="txt_to" runat="server" Width="85px" onkeydown="return false;"></asp:TextBox>

Update one table with another tables values


    UPDATE TBL1
    SET TBL1.COL = TBL2.COL2
    FROM TBL1 INNER JOIN TBL2
    ON TBL1.ID=TBL2.ID
    WHERE TBL2.COL >=1