我有一个带有可更改值的Javascript rails滑块,我想将其值绑定到asp标签并在后面的代码中使用,感谢您的帮助。
拉布勒:
<asp:Label ID="Lbl1" runat="server" Text="Label" Visible="False"></asp:Label>
的javascript:
<script type="text/javascript">
$("#appearance7").roundSlider({
radius: 70,
width: 8,
handleSize: "+16",
handleShape: "dot",
sliderType: "min-range",
value: 5,
max: 10,
mouseScrollAction: true,
min: 1
});
</script>
当前值为&#34; 5&#34;但它可以由用户更改,我想将此值分配给asp标签。
答案 0 :(得分:2)
$("#appearance7").roundSlider({
radius: 70,
width: 8,
handleSize: "+16",
handleShape: "dot",
sliderType: "min-range",
value: 5,
max: 10,
mouseScrollAction: true,
min: 1,
change: "onValueChange"
});
function onValueChange (e) {
$("#Lbl1").val(e.value);
}
&#13;
<asp:Label ID="Lbl1" runat="server" Text="Label" Visible="False" ClientIDMode="Static"></asp:Label>
&#13;