如何将 C# 中的参数传递到值部分,而不是使用不同的值对其进行硬编码。
<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 () {
// get the value that was rendered from the model
var progress = parseInt($(this).children(".progress-value").val());
// create the progress bar with the value
$(this).children(".property-progress").progressbar({ value: progress });
});
});
</script>