Pass parameters from C# into Jquery -


how pass parameter c# value part of instead of hard coding different values.

<div class="property-container">       <input class="progress-value" type="hidden" value="17" />                    <div class="property-title">test</div>          <div class="property-progress"></div>     </div>          <div class="property-container">         <input class="progress-value" type="hidden" value="32" />         <div class="property-title">test 2</div>          <div class="property-progress"></div>     </div>          <div class="property-container">         <input class="progress-value" type="hidden" value="24" />         <div class="property-title">test 3</div>          <div class="property-progress"></div>     </div>              <script type="text/javascript" >/             $(function () {                 // loop through each 'container'                 $(".property-container").each(function () {                       // value rendered model                     var progress = parseint($(this).children(".progress-value").val());                      // create progress bar value                     $(this).children(".property-progress").progressbar({ value: progress });                  });             });          </script> 

from comments

<input class="progress-value" type="hidden" value="17" id="test" />  in c# tried, test.value = "20"; 

you should have runat="server" if want access hidden field in codebehind.

<input class="progress-value" runat="server" type="hidden" value="17" id="test" />    //& in c# set this..   test.value = "20"; 

in jquery, value of hidden field

$('.progress-value').val() 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -