Summary of the problem I am having:
i have repeater that show questions and 4 option of answer , i want to show correct answer after one minute
Error I am receiving:
i can't abel to show CorrectAnswer after one minute
My code:
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="lblTime" runat="server" />
<br />
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
<ItemTemplate >
<div class="panel-heading">
<div class="panel-title btn-label q-border">
<h3 class="Golden-color"><span class="label label-success" style="margin-left:10px;" id="qid"><%# Eval("Category") %></span><%# Eval("Question") %></h3>
</div>
<h2 id="counter" class="Golden-color"></h2>
</div>
<div class="panel-body card ">
<div class="quiz" id="quiz" data-toggle="buttons">
<label class="element-animation1 btn btn-lg btn-transparent btn-block"><span class="btn-label"><i class="glyphicon">أ</i></span> <input type="radio" name="q_answer" value="1">
<%# Eval("OptionA") %>
</label>
<label class="element-animation2 btn btn-lg btn-transparent btn-block"><span class="btn-label"><i class="glyphicon">ب</i></span> <input type="radio" name="q_answer" value="2">
<%# Eval("OptionB") %>
</label>
<label class="element-animation3 btn btn-lg btn-transparent btn-block"><span class="btn-label"><i class="glyphicon">ج</i></span> <input type="radio" name="q_answer" value="3">
<%# Eval("OptionC") %>
</label>
<label class="element-animation4 btn btn-lg btn-transparent btn-block"><span class="btn-label"><i class="glyphicon">د</i></span> <input type="radio" name="q_answer" value="4">
<%# Eval("OptionD") %>
</label>
<asp:Label ID="LblCorrectAnswer" runat="server" Visible="false" Text='<%#Eval("CorrectAnswer")%>' CssClass="label label-success"></asp:Label>
</div>
</div>
</ItemTemplate>
</asp:Repeater>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DefaultConnection %>"
SelectCommand="SELECT TOP 1 * FROM Questions ORDER BY NEWID()"></asp:SqlDataSource>
<asp:Timer ID="Timer1" runat="server" OnTick="TimerTick" Interval="10000" Enabled ="true" />
</ContentTemplate>
</asp:UpdatePanel>
Protected Sub TimerTick(ByVal sender As Object, ByVal e As RepeaterItemEventArgs)
If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItemType.AlternatingItem Then
Dim lbl As Label = TryCast(e.Item.FindControl("LblCorrectAnswer"), Label)
lbl.Visible = True
End If
Timer1.Enabled = False
End Sub