Skip to content

NumericUpDown

MikhailTymchukDX edited this page Apr 29, 2016 · 2 revisions

NumericUpDownExtender (demo)

NumericUpDown is an ASP.NET AJAX extender that can be attached to an ASP.NET TextBox control to add the up and down buttons that increment and decrement a value in the TextBox. The increment and decrement actions can be simple +1/-1 arithmetic, cycle through the provided list of values (like months of the year), or call a Web Service to determine the next value. Page authors can also provide custom images to be used instead of the default up/down button graphics.

Properties

Name Description
Maximum The maximum value allowed by the extender
Minimum The minimum value allowed by the extender
Remarks: Currently, it does not prevent out-of-range values from being entered into the textbox even if Minimum or Maximum values are specified on the extender, but the use of the up/down buttons should bring a value into the allowed range on a click
RefValues A list of strings separated by semicolons (;) to be used as an enumeration by NumericUpDown
ServiceDownMethod A Web service method that returns data used to get the previous value or the name of a method declared on the page which is decorated with the WebMethodAttribute
Remarks: The signature of this method must match the following: [System.Web.Services.WebMethod] [System.Web.Script.Services.ScriptMethod] public int NextValue(int current, string tag) { ... }
ServiceDownPath A path to a web service that returns data used to get the previous value
Remarks: This property should be left null if ServiceUpMethod or ServiceDownMethod refers to a page method. The Web service should be decorated with the System.Web.Script.Services.ScriptService attribute
ServiceUpMethod A Web service method that returns data used to get the next value or the name of a method declared on the page that is decorated with the WebMethodAttribute
Remarks: The signature of this method must match the following: [System.Web.Services.WebMethod] [System.Web.Script.Services.ScriptMethod] public int NextValue(int current, string tag) { ... }
ServiceUpPath A path to a web service that returns data used to get the next value
Remarks: This property should be left null if ServiceUpMethod or ServiceDownMethod references a page method. The Web service should be decorated with the System.Web.Script.Services.ScriptService attribute
Step A step used for simple numeric incrementing and decrementing. The default value is 1
Tag A custom parameter to pass to the Web Service
TargetButtonDownID A reference to a custom Down button
TargetButtonUpID A reference to a custom Up button
Width Combined size of the TextBox and Up/Down buttons. The minimum value 25
Remarks: This property is not used if you provide custom buttons

Client properties

Name Description
maximum The maximum value allowed by the extender
minimum The minimum value allowed by the extender
refValues A list of strings separated by semicolons (;) to be used as an enumeration by NumericUpDown
serviceDownMethod A name of the method to call on the Web service (or the name of the PageMethod) to get the previous value
serviceDownPath A path to a Web service that returns data used to get the previous value
serviceUpMethod A name of the method to call on the Web service (or the name of the PageMethod) to get the next value
serviceUpPath A path to a web service that returns data used to get the next value
step A step used for simple numeric incrementing and decrementing. The default value is 1
tag Custom parameter to pass to the Web Service
targetButtonDownID A reference to a custom Down button
targetButtonUpID A reference to a custom Up button
width Combined size of the TextBox and Up/Down buttons. Minimum value 25

Client methods

Name Description
readValue() Reads a value of the associated textbox
setCurrentToTextBox(value) Sets a value of the associated textbox

Client events

Name Description
currentChanged Fires when the current textbox value changes

Client properties

width

Combined size of the TextBox and Up/Down buttons. Minimum value 25

Remarks: This property is not used if you provide custom buttons

Getter name: get_width()
Setter name: set_width(value)

tag

Custom parameter to pass to the Web Service

Getter name: get_tag()
Setter name: set_tag(value)

targetButtonUpID

A reference to a custom Up button

Getter name: get_targetButtonUpID()
Setter name: set_targetButtonUpID(value)

targetButtonDownID

A reference to a custom Down button

Getter name: get_targetButtonDownID()
Setter name: set_targetButtonDownID(value)

serviceUpPath

A path to a web service that returns data used to get the next value

Remarks: If the ServiceUpPath property is empty, the PageMethod will be used instead of the Web service

Getter name: get_serviceUpPath()
Setter name: set_serviceUpPath(value)

serviceUpMethod

A name of the method to call on the Web service (or the name of the PageMethod) to get the next value

Getter name: get_serviceUpMethod()
Setter name: set_serviceUpMethod(value)

serviceDownPath

A path to a Web service that returns data used to get the previous value

Remarks: If the ServiceDownPath property is empty, the PageMethod will be used instead of the Web service

Getter name: get_serviceDownPath()
Setter name: set_serviceDownPath(value)

serviceDownMethod

A name of the method to call on the Web service (or the name of the PageMethod) to get the previous value

Getter name: get_serviceDownMethod()
Setter name: set_serviceDownMethod(value)

refValues

A list of strings separated by semicolons (;) to be used as an enumeration by NumericUpDown

Getter name: get_refValues()
Setter name: set_refValues(value)

step

A step used for simple numeric incrementing and decrementing. The default value is 1

Getter name: get_step()
Setter name: set_step(value)

minimum

The minimum value allowed by the extender

Remarks: Currently, it does not prevent out of range values from being entered into the textbox even if Minimum or Maximum are specified on the extender, but using the up/down buttons should bring the value into the allowed range when clicked

Getter name: get_minimum()
Setter name: set_minimum(value)

maximum

The maximum value allowed by the extender

Getter name: get_maximum()
Setter name: set_maximum(value)

Client methods

readValue()

Reads a value of the associated textbox

setCurrentToTextBox(value)

Sets a value of the associated textbox

Params:

  • value
    • Type: String
    • Description: Value to set

Client events

currentChanged

Fires when the current textbox value changes

Add event handler method: add_currentChanged(handler)
Remove event handler method: remove_currentChanged(handler)
Raise event method: raise_currentChanged()

Clone this wiki locally