ARTICLE

NumericUpDown Extender Control in Ajax

Posted by Davin Martyn Articles | ASP.NET AJAX in VB.NET September 22, 2011
Here you will learn how can we increment and decrement integer value with the help of NumericUpDown Extender Control in Ajax.
 
Reader Level:

Introduction : NumericUpDown Extender Control can easily be associated with any TextBox control and allow user increment and decrement a value define at design time such as day, week or month in a year.

Step : 1 Open Visual Studio and select File menu  option.

  • Select Web Site option.
  • Selcet ASP.NET Web Site.
ASP-page1.gif

Step : 2  Go to Solution Explorer and right click.

  • Select Add New Items.
  • Select WebForms option.
webforms.gif

Step : 3  Drag and Drop Control in ToolBox.

  • Select TextBox control, NumericUpDown Extender Control.
  • Go to Source option and write a code.

Code :
<title>numeric updown control</title>
</head>
<
body>
<form id="form1" runat="server">
    <div>
     <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
<
table>
    <tr>
 <td>
select numeric value choose up and down button</td>
<
td>
        <asp:TextBox ID="TextBox1" runat="server" Text = "3" Width = "100px" style = "text-align:center"></asp:TextBox>
 </td>
        </tr>
        <tr>
        <td>select faviourate month</td>
        <td>
<asp:TextBox ID="TextBox2" runat="server" Text = "jun" Width = "100px" style = "text-align:center"></asp:TextBox>
        </td>
        </tr>
        <tr>
        <td>use image increment decrement</td>
        <td>
        <asp:TextBox ID="TextBox3" runat="server" Text = "0" Width ="100px" style = "text-align:center"></asp:TextBox>
</
td>       
        <td>
        <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl = "~/image2.gif" AlternateText = "UP" Width = "100PX" BorderColor = "Aqua" />
        <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl = "~/image4.gif"   AlternateText ="DOWN" Width = "100PX" BorderColor = "Azure" />
        </td>
        </tr>
        </table>
        <br />
        <br />
    <asp:NumericUpDownExtender ID="NumericUpDownExtender1" runat="server" TargetControlID = "TextBox1" Width = "150" RefValues = "" TargetButtonDownID = "" TargetButtonUpID = "" Maximum = "10" Minimum = "5">
    </asp:NumericUpDownExtender>
    <asp:NumericUpDownExtender ID="NumericUpDownExtender2" runat="server" TargetControlID = "TextBox2" Width = "150" RefValues = "jan;feb;mar;apr;may;jun;july;aug;sep;oct;nov;dec">
    </asp:NumericUpDownExtender>
    <asp:NumericUpDownExtender ID="NumericUpDownExtender3" runat="server" TargetControlID = "TextBox3" Width = "150" TargetButtonDownID = "ImageButton1" TargetButtonUpID = "ImageButton2">
    </asp:NumericUpDownExtender>
    </div>
    </form
>
</body>
</
html>

Step : 4 Press F5 and run.

increment.gif

Step : 5  When we click in Down and UP arrow value is decrease and increase.

incdec.gif

Login to add your contents and source code to this article
share this article :
post comment
 
Team Foundation Server Hosting
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
Team Foundation Server Hosting
Become a Sponsor