If else statement in html aspx

 <asp:TemplateField HeaderText="Task" HeaderStyle-BackColor="DarkBlue" HeaderStyle-ForeColor="White" ItemStyle-Width="5px">
                <ItemTemplate>
                    if<%#DataBinder.Eval(Container.DataItem, "stat")%>=="S2"
                    {
                    <a href="QP_OJT.aspx?Emp_id=<%#DataBinder.Eval(Container.DataItem, "EMP_ID")%>&Train_B_N=<%#DataBinder.Eval(Container.DataItem, "Train_B_N")%>&Train_ID=<%#DataBinder.Eval(Container.DataItem, "Train_ID")%>" class="btn btn-primary btn-sm">QP-003/05/02</a>
                    }else
                    {
                    <a href="QP_Eval.aspx?Train_ID=<%#DataBinder.Eval(Container.DataItem, "Train_ID")%>" class="btn btn-primary btn-sm">QP-003/09/03</a>
                }
            </ItemTemplate>

i have 2 buttons in 1 gridview column,if stat = “s2”,QP-003/05/02 visible = true,else QP-003/05/02 is visible is false. please guide me on this,thank you.

I can’t say I can offer anything on .aspx itself, but I’m not at all sure what your question is. What do you need guidance on, and what is it you are trying to achieve?

my if else statement in html not working

You’ll need to explain what you mean by “not working”.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.