【发布时间】:2023-03-13 20:43:01
【问题描述】:
我在我的 MVC 应用程序中使用 kendo.ui.Slider,如下所示:
@(Html.Kendo().Slider()
.Name("slider") //The name of the slider is mandatory. It specifies the "id" attribute of the widget.
.Min(0) //Set min value of the slider
.Max(100000) //Set min value of the slider
.Value(50000) //Set the value of the slider
.SmallStep(1000)
.LargeStep(10000)
.HtmlAttributes(new { style = "width:700px;" })
.Tooltip(tooltip =>
{
tooltip.Format("{0:n0}");
})
.Events(e =>
{
e.Change("sliderOnChange");
})
)
<script>
function sliderOnChange(e) {
var slider = $("#slider").data("kendoSlider");
var sliderValue = slider.value();
alert(sliderValue);
}
</script>
如何绑定模型值而不是在这里分配静态值 (.Value(50000))?
【问题讨论】:
标签: javascript asp.net-mvc asp.net-mvc-4 kendo-ui slider