Progress bar Issue
I am having an aspx file and an ascx file(Details.ascx). In my ascx file, I am having the following code..
<script type="text/javascript">
$(function () {
var a = document.getElementById("HidStatus").value;
var b = parseInt(a);
$("#progressbar").progressbar({
value: b,
max: 100
});
});
</script>
<fieldset>
<div id="progressbar" style="height: 8px; float: left; padding: .3%; margin-right: 274px;
margin-left: auto; width: 300px;">
</div>
<div id="Div1" style="float: left; margin-left: 300px; margin-right: 100px">
<%= Html.Hidden("HidStatus", (double)ViewData["StatusBar"])%>
<%= Html.Label(Convert.ToString(ViewData["StatusBar"] + "% Completed"))%>
</div>
</fieldset>
In my aspx file....
<script type="text/javascript">
function Load() {
$.ajaxSettings.cache = false;
var Id = document.getElementById("Id").value;
if (Id != null && Id != "") {
$.ajax({
type: "GET",
url: "../Test/Populate",
data: "&Id=" + Id.toString(),
success: function (msg) {
if (msg != null && msg != "") {
alert(msg);
//document.getElementById("TargetId").innerHTML = msg;
$('#TargetId').html(msg);
}
else {
}
},
error: function (msg) { }
});
}
}
</script>
<div class="content-admin">
<div class="form-content">
<div id="TargetId">
<% Html.RenderPartial("Details"); %>
<开发者_如何学编程;/div>
</div>
</div>
For the first time, the progressbar got loaded..Whenever I made selected index changes, the progress bar disappears...
I think,this line document.getElementById("ProvideFeedbackDetailsTargetId").innerHTML = msg;
may be the reason for issue...But dont know what to do....
How to solve this...
Looks like you are using jQuery. Could you change all your document.getElementById() calls to jquery calls like
document.getElementById("TargetId").innerHTML = msg;
will be in jquery:
$('#TargetId').html(msg);
This could be starter for solving the issues, also debugin with firebug on firefox could help.
精彩评论