簡體   English   中英

如何將javascript的值綁定到asp C#中的標簽

[英]how to bind value of javascript to a lable in asp C#

我有一個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>

當前值為“ 5”,但用戶可以更改,我想將此值分配給asp標簽。

  $("#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); } 
 <asp:Label ID="Lbl1" runat="server" Text="Label" Visible="False" ClientIDMode="Static"></asp:Label> 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM