<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"></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">ج</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">د</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
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)