This is my HTML
code:
<div id="page" class="page chartContainer">
<h1>Your Score is</h1>
<div class="progress-bar">
<canvas id="inactiveProgress" class="progress-inactive" height="275px" width="275px"></canvas>
<canvas id="activeProgress" class="progress-active" height="275px" width="275px"></canvas>
<p id="percentagediv" runat="server"></p>
</div>
<div id="progressControllerContainer" runat="server">
<input type="range" runat="server" id="progressController" min="0" max="200"/>
</div>
</div>
This is where I'm binding value from code behind: <p id="percentagediv" runat="server"></p>
.
This is my C#
code:
if (Convert.ToInt32(dt.Rows[0][1]) != 0 && Convert.ToInt32(dt.Rows[1][1]) != 0)
{
int achived = Convert.ToInt32(dt.Rows[0][1]);
int trget = Convert.ToInt32(dt.Rows[1][1]);
int percentage = (int)Math.Round((double)(100 * achived) / trget);
percentagediv.InnerHtml = percentage + "%";
}
else
{
percentagediv.InnerHtml = 0 + "%";
}
I have debugged it value coming in that percentagediv
but on front page it is displaying as NaN
?
What is wrong here? Any help would be much appreciated. Thanks!