给RequiredFieldValidator后,注销按钮不起作用 [英] after giving RequiredFieldValidator the logout button not working

查看:66
本文介绍了给RequiredFieldValidator后,注销按钮不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<pre>
    <tr>
    <td align="left">&nbsp;
    <asp:label id="lblOpenid" cssclass="lblOpen" runat="server" text="Open jobs By Specific Id" xmlns:asp="#unknown">
    </asp:label>
    <asp:textbox id="TextBox1" runat="server" width="78px" causesvalidation="true" xmlns:asp="#unknown">
    </asp:textbox>
    <asp:button id="Button1" runat="server" text="Click" onclick="Button1_Click" xmlns:asp="#unknown" /><br />
    <asp:requiredfieldvalidator id="RequiredFieldValidator1" runat="server" controltovalidate="TextBox1" errormessage="Plz enter Problem ID"        xmlns:asp="#unknown">
    </asp:requiredfieldvalidator>
        </td>
    </tr>
    <tr>
    <td align="left">&nbsp
    <asp:label id="lblCloseid" cssclass="lblClose" runat="server" text="Close jobs By Specific Id" xmlns:asp="#unknown">
    </asp:label>
    <asp:textbox id="TextBox2" runat="server" width="76px" causesvalidation="true" xmlns:asp="#unknown">
    </asp:textbox>
    <asp:button id="Button2" runat="server" text="Click" onclick="Button2_Click" xmlns:asp="#unknown" />
    <br />
    <asp:requiredfieldvalidator id="RequiredFieldValidator2" runat="server" controltovalidate="TextBox2" errormessage="Plz enter Problem ID"            xmlns:asp="#unknown">
    </asp:requiredfieldvalidator>
    </td>
    </tr>
   <table>
   <tr>
   <td style="width: 211px" valign="top" align="center">
   <asp:button id="btnLogout" runat="server" backcolor="#6699cc" bordercolor="#6699cc" xmlns:asp="#unknown"

                        BorderStyle="None" CausesValidation="true" ForeColor="White" OnClick="btnLogout_Click"

                        Text="Logout" Visible="true" Width="98px" />
   </asp:button>
   </td>

   </tr>
   </table>
</pre>

推荐答案

嗨avijit1112010


添加属性CausesValidation ="false"
登录按钮,
然后希望它将起作用


Jojo Lili
Hi avijit1112010


Add an attribute CausesValidation ="false"
in log out button,
then hopefully it will work


Jojo Lili


为btnLogout设置
Set
CausesValidation="false"

. :)


这篇关于给RequiredFieldValidator后,注销按钮不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆