How to disable asp.net button on postback ?


DisableButton
Hi

Recently in one project there was requirement to disable asp.net Submit button on postback then i did like this using inline javascript

  <asp:Button runat="server" ID="BtnSubmit" 
  OnClientClick="this.disabled = true; this.value = 'Submitting...';" 
  UseSubmitBehavior="false" 
  OnClick="BtnSubmit_Click" 
  Text="Submit" />

Code Cleanup free tool for Visual studio 2010/12


Hi

Recently i was doing code cleanup of my project. I was searching some tool for this work then i got very nice tool. It is really very useful tool for developer. You also just try it.

You can download from here

http://visualstudiogallery.msdn.microsoft.com/76293c4d-8c16-4f4a-aee6-21f83a571496/

You can read the documentation from here

http://www.codemaid.net/documentation/#reorganizing

I hope it will help to other developers.

How to integrate Twitter like plugin in website ?


twitter

Hi

If we have to integrate Twitter like plugin in website. Then we can integrate like this.

Step 1: Download the jquery.followbox.min.js plugin
Step 2: Give the UserId of your twitter Account

<%@ 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>
    <title></title>
       <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>

    <link href="followbox.css" rel="stylesheet" type="text/css" />
    <script src="jquery.followbox.min.js" type="text/javascript"></script>
    <script type="text/javascript">
   $(function(){
   $('#mytwitterfollowbox').followbox({
       user: 'Chandradev819'
   });
   });
   </script>
</head>
<body>
    <form id="form1" runat="server">
   <div id="mytwitterfollowbox" class="follow-box-container"></div>
    </form>
</body>
</html>


.

You can download the code from here.

How to create effect on Textbox using CSS ?


CssEffect

Hi

We can add very nice effect on asp.net Textbox using this CSS like this


<%@ 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></title>
    <style type="text/css">
    text {
    border: 1px solid #666;
    border-radius: 5px;
    padding: 3px;
}

.text:focus {
    border: 1px solid #07c;
    box-shadow: 0 0 5px #07c;
    outline: none;
}
    
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        UserName : <asp:TextBox ID="TextBox1" CssClass="text" runat="server"></asp:TextBox>
        <br /> <br /> 
        Password&nbsp; : <asp:TextBox ID="TextBox2" CssClass="text" runat="server"></asp:TextBox>
        <br />
        
    </div>
    </form>
</body>
</html>

How to use Masked Edit ajax validator control for Date ?


Mask

If we have to validate Textbox for Date format then “Ajax Masked Edit” control is one of the easiest solution to do this task. We can do like this

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<!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></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <asp:Image ID="Image1" ImageUrl="~/Calendar_scheduleHS.png" runat="server" />
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>

        <asp:MaskedEditExtender   
            ID="MaskedEditExtender1"  
            runat="server"  
            TargetControlID="TextBox1" 
            Mask="99/99/9999"   
            MaskType="Date" 
           CultureName="en-US" 
            MessageValidatorTip="true"/>  
     
         
        <asp:MaskedEditValidator   
            ID="MaskedEditValidator1"  
            runat="server"  
            ControlToValidate="TextBox1"  
            ControlExtender="MaskedEditExtender1"  
            IsValidEmpty="false"/>  
    
        <asp:CalendarExtender ID="CalendarExtender1" TargetControlID="TextBox1" format="dd/MM/yyyy"  PopupButtonID="Image1" runat="server"/>
        <br />
    </div>
    </form>
</body>
</html>