2

I need something with similar functionality to the NumericUpDown tool of Windows Forms, and I've been informed that there is a javascript function of this nature. All the guides I can find from a google search seem to cover print functions and other features, that I'm not sure how to adapt.

How would I incorporate the javascript function into my web form and pass it's value reliably to the corresponding c# method?

Please forgive me if this is a silly question, I'm comparatively new to programming in general.

  • Depending on the browsers you target, there is an [``](http://caniuse.com/#feat=input-number) that's a built-in "up/down" input. – Hans Kesting Jun 23 '14 at 14:15
  • You can use some jquery plugin for numeric updown, and then use jquery ajax request to submit values to C# function. – Asad Ullah Jun 23 '14 at 14:16
  • 1
    @HansKesting this should work OK, I'm in a corporate environment where everyone has at least IE9. How would I implement this in a C# webform? –  Jun 23 '14 at 14:17
  • IE9 doesn't support it, IE10/11 don't show the up/down buttons. Apart from that, you could use `` – Hans Kesting Jun 23 '14 at 14:24

1 Answers1

1

You can use Spinner plugin for JQuery.

From the client side using Jquery's Ajax method you can pass the variables to backend.

This question might help calling web methods via Ajax.

Community
  • 1
  • 1
Semih Yagcioglu
  • 4,011
  • 1
  • 26
  • 43
  • 1
    How would I implement this in C#? is it a question of just placing it in the aspx page that I'm working in, and surrounding it with ? –  Jun 23 '14 at 14:22
  • From the client side you can get the values using javascript. Then pass these values to a web method that is written in C#. In short, it would be better to place client side scripts in ASPX page. – Semih Yagcioglu Jun 23 '14 at 14:24