我在上面的LinkButtons中调用java脚本,并且所有LinkButton都在gridview中,基于问题序列号,可以看到LinkButtons。我上面的LinkButton4工作不正常,OR
条件无法正常工作。当我在序列号1或5或10时,然后显示两次按钮。我认为linkbutton4在序列号1或5或10中不是vi-sibling false。
在GridView内使用LinkButtons。
<asp:LinkButton CssClass="btn savennext btn-large skip" ID="LinkButton_SAVE_NEXT"
OnClick="LinkButton_SAVE_NEXT_Click" runat="server" Visible='<%# Eval("QuestionSNo").ToString() == "1"%>' OnClientClick="return takepic();">SAVE & NEXT</asp:LinkButton>
<asp:LinkButton CssClass="btn savennext btn-large skip" ID="LinkButton1"
OnClick="LinkButton_SAVE_NEXT_Click" runat="server" Visible='<%# Eval("QuestionSNo").ToString() == "5"%>' OnClientClick="return takepic1();">SAVE & NEXT</asp:LinkButton>
<asp:LinkButton CssClass="btn savennext btn-large skip" ID="LinkButton3"
OnClick="LinkButton_SAVE_NEXT_Click" runat="server" Visible='<%# Eval("QuestionSNo").ToString() == "10"%>' OnClientClick="return takepic2();">SAVE & NEXT</asp:LinkButton>
<asp:LinkButton CssClass="btn savennext btn-large skip" ID="LinkButton4"
OnClick="LinkButton_SAVE_NEXT_Click" runat="server" Visible='<%# Eval("QuestionSNo").ToString() != "1" || Eval("QuestionSNo").ToString() != "5" || Eval("QuestionSNo").ToString() != "10"%>'>SAVE & NEXT</asp:LinkButton>
答案 0 :(得分:0)
您的按钮可见性设置应为 AND ,否则它始终返回true。
检查一下:
<asp:LinkButton CssClass="btn savennext btn-large skip" ID="LinkButton4"
OnClick="LinkButton_SAVE_NEXT_Click" runat="server" Visible='<%# Eval("QuestionSNo").ToString() != "1" && Eval("QuestionSNo").ToString() != "5" && Eval("QuestionSNo").ToString() != "10"%>'>SAVE & NEXT</asp:LinkButton>