简体   繁体   English

如何将javascript的值绑定到asp C#中的标签

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

I have a Javascript rails slider with changeable value, i want to bind its value to a asp label and use in in code behind, thanks for your help. 我有一个Javascript Rails滑块,其值可以更改,我想将其值绑定到asp标签,并在后面的代码中使用,谢谢您的帮助。

lable: 标签:

<asp:Label ID="Lbl1" runat="server" Text="Label" Visible="False"></asp:Label> 

javascript: 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>

the current value is "5" but it can be changed by user and i want to assign this value to asp label. 当前值为“ 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.

相关问题 在ASP.NET页面C#中使用JavaScript将当前日期显示为Lable文本 - Display Current Date as Lable Text using JavaScript in ASP.NET page C# 如何使用 asp.net C# 在页面加载时绑定 JavaScript 事件 - How to bind JavaScript event on page load using asp.net C# 如何更改定标中的标签值? - How to Change value of lable in qualtrics? 当值由javascript c#asp.net更改时如何从TemplateField中的文本框获取值 - How to get value from TextBox in TemplateField when value change by javascript c# asp.net 5秒后使用C#中的javascript / jquery函数隐藏div和标签 - hide a div and lable after 5 second using javascript/jquery function in c# 如何将值从javascript变量传递给asp.net mvc中的c#变量 - how to pass a value from javascript variable to c# variable in asp.net mvc 如何在ASP.NET C#中使用javascript从ajax组合框中获取选定的值 - how to get selected value from ajax combobox using javascript in asp.net c# 如何在javascript中设置asp.net隐藏字段并访问c#代码后面的值 - how to set asp.net hidden field in javascript and access the value in c# code behind 如何在asp.net mvc中使用razor viewmodel将c#guid值赋给javascript变量? - How to assign c# guid value to javascript variable using razor viewmodel in asp.net mvc? 如何使用Asp.net C#中创建的JavaScript读取Cookie值 - how read cookie value using javascript created in Asp.net C#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM