Wednesday 11 September 2013

How to use ASP.NET AJAX ALWAYS VISIBLE CONTROL EXTENDER

How to use ASP.NET AJAX ALWAYS VISIBLE CONTROL EXTENDER


1) Create Website
2) Add aspx page
3) Add toolkitScriptManager
4) If you don't have ajax control toolkit  download from codeplex
5) Add Always Visible Extender
  control

asp:AlwaysVisibleControlExtender  properties
1)TargetControlID  -> Panel/Label
2) VerticalSide ->   Vertical position of the TargetControl
3)HorizontalSide-> Horizontal position of the TargetControl
4) VeritcalOffset
5) Horizontaloffset


This example has 3 check boxes, whenever user selected check box(in shopping cart). amount will be displayedin Always Visible Extender control(even when user scrolls down/up, This control will be visible).


      <center>
      
        <asp:CheckBox ID="chkMemory" runat="server" 
        Text="Memory$350" 
        AutoPostBack="true" 
        OnCheckedChanged="chk_changed" /><br />
        <asp:CheckBox ID="chkHDD" runat="server" 
        
        Text="HDD$100"  AutoPostBack="true" 
        OnCheckedChanged="chk_changed" /><br />
        <asp:CheckBox ID="chkCamera" runat="server" 
        Text="Camera$80"  AutoPostBack="true" 
        OnCheckedChanged="chk_changed"/><br />
        </center>

        <asp:Label ID="lblCost" runat="server"
         Text="Cost:0" BackColor="DarkBlue" 
         ForeColor="White" Font-Bold="true"
         Font-Size="Larger"
        ></asp:Label>

        <asp:AlwaysVisibleControlExtender runat="server" 
        VerticalSide="Bottom"
         HorizontalSide="Right" 
         TargetControlID="lblCost" 
         VerticalOffset="100" 
         HorizontalOffset="100">
         </asp:AlwaysVisibleControlExtender>



No comments:

Post a Comment