动态更改引导组件的值

我正在尝试更改将在按钮单击事件上更改的引导程序组件中的值


这是我的组件。它是一个小条,根据通过标记代码输入的值填充到特定百分比


<div class="progress">

 <div id="theprogressbar" class ="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="95" aria-valuemin="0" aria-valuemax="100" 

style="width: 95%">

  <span class="sr-only">95% Complete</span>

    </div>

 </div>

style="width: 95%"需要更改以更改条形填充的百分比。这是引导程序组件外观的示例

http://img1.mukewang.com/60bad2cc00015e8c12650122.jpg

我将如何更改按钮单击事件中的百分比值?提前致谢,如果我看起来含糊,对不起!c# 是我使用的编码语言,这是在 Web 表单上进行的


更新:JQUERY 代码


<script>



$('#btnSave').click(function () {

    $.ajax({


    url: 'http://localhost:61417/ProjectMainMenu/GetProgress',

    method: 'POST',

    contentType: 'application/json',

    success: function(response){

        var progressValue=response.d;

        $('#theprogressbar').attr('aria-valuenow', progressValue).css('width',progressValue);

        $("#progressValue").text(progressValue);

    }

        });


     </script>

代码


      [WebMethod]

public static double GetProgress()

{

     double progress=0;

     //Your Business Logic

     progress=56;

     return progress;

}

按钮标记代码


<asp:Button ID="btnSave" width =" 250px" runat="server" Text="View"  class="btn btn-info" />



噜噜哒
浏览 115回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP