我正在使用2个链接按钮(协调器和人员),其中on_Click动作显示相应的面板,要求登录/注册/忘记密码。 如果用户选择了注册/忘记密码,则会弹出一个弹出窗口(使用ModalPopupExtender)以询问信息。 除非并直到我在面板中使用了必需的字段验证器,否则一切运行良好,当用户单击“注册/忘记密码”时该面板会弹出。 如果我使用必需的字段验证器,则我的页面运行良好,并且当我单击任何链接按钮(协调器/工作人员)时,什么都不会发生。 这是aspx代码:

    <html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type = "text/css">
        .modalBackground 
    { 
        background-color: gray; 
    }
    .modalPopup 
    { 
        background-color: white; 
        border-width: 3px; 
        border-style: solid; 
        border-color: black; 
        padding-top: 10px; 
        padding-left: 10px; 
        width: 300px; 
        height: 140px;
    }
    .panel
    {
        background : gray;
        padding : 10px;
    }
    div ul ul 
    {
        display: none;
    }
    div ul li:hover > ul 
    {
        display: block;
    }
    div ul li ul:hover > ul 
    {
        display: block;
    }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Names="Arial" Font-Size="XX-Large" Text="Automated Examination System"></asp:Label><br />&nbsp;<br /><br />&nbsp;
    <asp:Panel ID = "MainPanel" runat = "server" Height="181px" Width="275px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <ul>
    <li style="margin-left: 33px; width: 169px;">&nbsp;<asp:LinkButton ID = "LinkAdmin" runat = "server" onclick="LinkAdmin_Click">Coordinator</asp:LinkButton></li>
    <li style="width: 172px; margin-left: 33px">&nbsp;<asp:LinkButton ID="LinkStaff" runat="server" onclick="LinkStaff_Click">Staff</asp:LinkButton></li>
    <li style="margin-left: 33px">&nbsp;<asp:LinkButton ID = "LinkStudent" runat = "server">Student</asp:LinkButton>
            <ul>
            <li><asp:LinkButton ID = "LinkButton1" runat = "server">Fresh Registration</asp:LinkButton></li>
            <li><asp:LinkButton ID = "LinkButton2" runat = "server">Re Registration</asp:LinkButton></li>
            </ul>
        </li>
    </ul>
    </asp:Panel>

    <asp:Panel ID="InfoPanel" runat="server" style="left: 290px; top: 104px; position: absolute; height: 375px; width: 611px"><br /><br /><br />
        <asp:Label ID="Label2" runat="server" Font-Bold="False" Font-Names="Arial" Font-Size="Medium" Text="The Automated Examination system will allow post graduation student and under graduation students to register their respective courses for their respective semester. "></asp:Label>
        <asp:Label ID="Label3" runat="server" Font-Bold="False" Font-Names="Arial" Font-Size="Medium" Text="Once the registration process is completed for a student the system sends information to the controller of examination."></asp:Label><br />
        <asp:Label ID="Label4" runat="server" Font-Bold="False" Font-Names="Arial" Font-Size="Medium" Text="Each staff will be able to enter the CIE1 and CIE2 marks based on the privileges provided by coordinator of that respective department. "></asp:Label><br />
        <asp:Label ID="Label5" runat="server" Font-Bold="False" Font-Names="Arial" Font-Size="Medium" Text="Once the staff enters marks for CIE1/CIE2, they won’t be allowed to make changes later on. "></asp:Label><br />
        <asp:Label ID="Label6" runat="server" Font-Bold="False" Font-Names="Arial" Font-Size="Medium" Text="After submitting the marks, the staff will be given with print out of the entered marks for further reference. "></asp:Label><br />
        <asp:Label ID="Label7" runat="server" Font-Bold="False" Font-Italic="False" Font-Names="Arial" Font-Size="Medium" Text="At the end of a semester each student SGPA is calculated and the controller take a back up copy of grade cards and result sheet of all the students. "></asp:Label><br />
        <asp:Label ID="Label9" runat="server" Font-Bold="False" Font-Names="Arial" Font-Size="Medium" Text="Since student grades are sensitive information certain measures are taken to prevent unauthorized access. "></asp:Label><br />
        <asp:Label ID="Label8" runat="server" Font-Bold="False" Font-Names="Arial" Font-Size="Medium" Text="The system also generate the transcript of student which contains all semester marks, Course Title in that particular semester, SGPA of each semester and overall CGPA of that student. "></asp:Label>
    </asp:Panel>

    <asp:Panel ID="AdminLogin" runat="server" style= "left: 906px; top: 105px; position: absolute; " Visible="False" Width="430px"><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Label ID="Label10" runat="server" Text="Coordinator Login"></asp:Label><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Label ID="Label11" runat="server" Text="Select Department : "></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:DropDownList ID="DropDownList1" runat="server"  ValidationGroup="AdminLogin"></asp:DropDownList>&nbsp;
            <asp:RequiredFieldValidator ID="AdminReq1" runat="server" ControlToValidate="DropDownList1" ErrorMessage="Department is blank" ForeColor="Red" ValidationGroup="AdminLogin"></asp:RequiredFieldValidator><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Label ID="Label12" runat="server" Text="Select Branch : "></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:DropDownList ID="DropDownList2" runat="server" ValidationGroup="AdminLogin"></asp:DropDownList>&nbsp;
            <asp:RequiredFieldValidator ID="AdminReq2" runat="server" ControlToValidate="DropDownList2" ErrorMessage="Branch is blank" ForeColor="Red" ValidationGroup="AdminLogin"></asp:RequiredFieldValidator><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Label ID="Label13" runat="server" Text="Username : "></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:TextBox ID="AdminTxt1" runat="server" ValidationGroup="AdminLogin" style="height: 22px"></asp:TextBox>
            <asp:RequiredFieldValidator ID="AdminReq3" runat="server" ControlToValidate="AdminTxt1" ErrorMessage="Username is blank" ForeColor="Red" ValidationGroup="AdminLogin"></asp:RequiredFieldValidator><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Label ID="Label14" runat="server" Text="Password : "></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:TextBox ID="AdminTxt2" runat="server" TextMode="Password" ValidationGroup="AdminLogin"></asp:TextBox>
            <asp:RequiredFieldValidator ID="AdminReq4" runat="server" ControlToValidate="AdminTxt2" ErrorMessage="Password is blank" ForeColor="Red" ValidationGroup="AdminLogin"></asp:RequiredFieldValidator><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="AdminLog" runat="server" Text="Login" Width="80px" ValidationGroup="AdminLogin" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="AdminSignUp" runat="server" Text="New Coordinator" Width="110px"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="AdminForPwd" runat="server" Text="Forgot Password" />
     </asp:Panel>

    <asp:Panel ID="StaffLogin" runat="server" style="left: 906px; top: 105px; position: absolute;" Visible="False" Width="430px"><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Label ID="Label15" runat="server" Text="Staff Login"></asp:Label><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Label ID="Label16" runat="server" Text="Username : "></asp:Label>&nbsp;
        <asp:TextBox ID="StaffTxt1" runat="server" Width="127px" ValidationGroup="StaffLogin"></asp:TextBox>
        <asp:RequiredFieldValidator ID="StaffReq1" runat="server" ControlToValidate=" StaffTxt1" ErrorMessage="Username is blank" ForeColor="Red" ValidationGroup="StaffLogin"></asp:RequiredFieldValidator><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Label ID="Label17" runat="server" Text="Password : "></asp:Label>&nbsp;
        <asp:TextBox ID="StaffTxt2" runat="server" TextMode="Password" ValidationGroup="StaffLogin"></asp:TextBox>
        <asp:RequiredFieldValidator ID="StaffReq2" runat="server" ControlToValidate=" StaffTxt2" ErrorMessage="Password is blank" ForeColor="Red" ValidationGroup="StaffLogin"></asp:RequiredFieldValidator><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="StaffLog" runat="server" Text="Login" Width="80px" ValidationGroup="StaffLogin" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="StaffSignUp" runat="server" Text="New Staff" Width="82px"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="StaffForPwd" runat="server" Text="Forgot Password" Width="110px" />
    </asp:Panel>

    <asp:Panel ID="StaffSP" CssClass="modalPopup" style="display: none" runat="server">&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Label ID="Label18" runat="server" Text="Staff Sign Up" Font-Size="XX-Large"></asp:Label><br /><br />&nbsp;&nbsp;
        <asp:Label ID="Label19" runat="server" Text="Enter Course Code : "></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="StaffSPTxt1" runat="server"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:RequiredFieldValidator ID="StaffSPReq1" runat="server" ErrorMessage="Course Code is BLANK" ForeColor="Red" ControlToValidate="StaffSPTxt1"></asp:RequiredFieldValidator><br /><br />&nbsp;&nbsp;
        <asp:Label ID="Label20" runat="server" Text="Enter Password : "></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="StaffSPTxt2" runat="server" TextMode="Password"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:RequiredFieldValidator ID="StaffSPReq2" runat="server" ErrorMessage="Password is BLANK" ForeColor="Red" ControlToValidate="StaffSPTxt2"></asp:RequiredFieldValidator><br /><br />&nbsp;&nbsp;
        <asp:Label ID="Label21" runat="server" Text="Retype Password : "></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="StaffSPTxt3" runat="server" TextMode="Password"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:CompareValidator ID="StaffSPCom1" runat="server" ErrorMessage="Password Mismatch" ForeColor="Red" ControlToCompare="StaffSPTxt2" ControlToValidate="StaffSPTxt3"></asp:CompareValidator><br /><br />&nbsp;&nbsp;
        <asp:Label ID="Label22" runat="server" Text="Enter Password Hint : "></asp:Label>&nbsp;&nbsp;
        <asp:TextBox ID="StaffSPTxt4" runat="server" TextMode="Password"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:RequiredFieldValidator ID="StaffSPReq3" runat="server" ErrorMessage="Password Hint is BLANK" ForeColor="Red" ControlToValidate="StaffSPTxt4"></asp:RequiredFieldValidator><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button3" runat="server" Text="Sign Up" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
        <asp:Button ID="Button4" runat="server" Text="Cancel" />
    </asp:Panel>

    <asp:Panel ID="StaffFP" CssClass="modalPopup" style="display: none" runat="server">&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Label ID="Label23" runat="server" Text="Staff Forgot Password" Font-Size="XX-Large"></asp:Label><br /><br />&nbsp;&nbsp;
        <asp:Label ID="Label24" runat="server" Text="Enter Username : "></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="StaffFPTxt1" runat="server"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:RequiredFieldValidator ID="StaffFPReq1" runat="server" ErrorMessage="Username is BLANK" ForeColor="Red" ControlToValidate="StaffFPTxt1"></asp:RequiredFieldValidator><br /><br />&nbsp;&nbsp;
        <asp:Label ID="Label25" runat="server" Text="Enter Password Hint : "></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="StaffFPTxt2" runat="server" TextMode="Password"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:RequiredFieldValidator ID="StaffFPReq2" runat="server" ErrorMessage="Hint is BLANK" ForeColor="Red" ControlToValidate="StaffFPTxt2"></asp:RequiredFieldValidator><br /><br />&nbsp;&nbsp;
        <asp:Button ID="Button5" runat="server" Text="GetPassword" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
        <asp:Button ID="Button6" runat="server" Text="Cancel" />
    </asp:Panel>

    <asp:Panel ID="AdminSP" CssClass="modalPopup" style="display: none" runat="server">&nbsp;&nbsp;
        <asp:Label ID="Label26" runat="server" Text="Coordinator Sign Up" Font-Size="XX-Large"></asp:Label><br /><br />&nbsp;&nbsp;
        <asp:Label ID="Label27" runat="server" Text="Select Department : "></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:DropDownList ID="AdminSPDrp1" runat="server" ></asp:DropDownList>
        <asp:RequiredFieldValidator ID="AdminSPReq1" runat="server" ErrorMessage="Department is BLANK" ForeColor="Red" ControlToValidate="AdminSPDrp1"></asp:RequiredFieldValidator><br /><br />&nbsp;&nbsp;
        <asp:Label ID="Label28" runat="server" Text="Select Branch : "></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:DropDownList ID="AdminSPDrp2" runat="server" ></asp:DropDownList>
        <asp:RequiredFieldValidator ID="AdminSPReq2" runat="server" ErrorMessage="Branch is BLANK" ForeColor="Red" ControlToValidate="AdminSPDrp2"></asp:RequiredFieldValidator><br /><br />&nbsp;&nbsp;
        <asp:Label ID="Label29" runat="server" Text="Enter Username : "></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="AdminSPTxt1" runat="server"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:RequiredFieldValidator ID="AdminSPReq3" runat="server" ErrorMessage="Username is BLANK" ForeColor="Red" ControlToValidate="AdminSPTxt1"></asp:RequiredFieldValidator><br /><br />&nbsp;&nbsp;
        <asp:Label ID="Label30" runat="server" Text="Enter Password : "></asp:Label>&nbsp;&nbsp;
        <asp:TextBox ID="AdminSPTxt2" runat="server" TextMode="Password"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:RequiredFieldValidator ID="AdminSPReq4" runat="server" ErrorMessage="Password is BLANK" ForeColor="Red" ControlToValidate="AdminSPTxt2"></asp:RequiredFieldValidator><br /><br />&nbsp;&nbsp;
        <asp:Label ID="Label31" runat="server" Text="Retype Password : "></asp:Label>&nbsp;&nbsp;
        <asp:TextBox ID="AdminSPTxt3" runat="server" TextMode="Password"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:CompareValidator ID="AdminSPCom1" runat="server" ControlToValidate = "AdminSPTxt3" ControlToCompare = "AdminSPTxt2" ErrorMessage="Password Mismatch" ForeColor="Red"></asp:CompareValidator><br /><br />&nbsp;
        <asp:Label ID="Label32" runat="server" Text="Enter Password Hint : "></asp:Label>&nbsp;&nbsp;
        <asp:TextBox ID="AdminSPTxt4" runat="server" TextMode="Password"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:RequiredFieldValidator ID="AdminSPReq5" runat="server" ErrorMessage="Hint is BLANK" ForeColor="Red" ControlToValidate="AdminSPTxt4"></asp:RequiredFieldValidator><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button7" runat="server" Text="Sign Up" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
        <asp:Button ID="Button8" runat="server" Text="Cancel" />
    </asp:Panel>

    <asp:Panel ID="AdminFP" CssClass="modalPopup" style="display: none" runat="server">&nbsp;&nbsp;
        <asp:Label ID="Label33" runat="server" Text="Coordinator Forgot Password" Font-Size="XX-Large"></asp:Label><br /><br />&nbsp;&nbsp;
        <asp:Label ID="Label34" runat="server" Text="Select Department : "></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:DropDownList ID="AdminFPDrp1" runat="server" ></asp:DropDownList>
        <asp:RequiredFieldValidator ID="AdminFPReq1" runat="server" ErrorMessage="Department is BLANK" ForeColor="Red" ControlToValidate="AdminFPDrp1"></asp:RequiredFieldValidator><br /><br />&nbsp;&nbsp;
        <asp:Label ID="Label35" runat="server" Text="Select Branch : "></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:DropDownList ID="AdminFPDrp2" runat="server" ></asp:DropDownList>
        <asp:RequiredFieldValidator ID="AdminFPReq2" runat="server" ErrorMessage="Branch is BLANK" ForeColor="Red" ControlToValidate="AdminFPDrp2"></asp:RequiredFieldValidator><br /><br />&nbsp;&nbsp;
        <asp:Label ID="Label36" runat="server" Text="Enter Username : "></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="AdminFPTxt1" runat="server"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:RequiredFieldValidator ID="AdminFPReq3" runat="server" ErrorMessage="Username is BLANK" ForeColor="Red" ControlToValidate="AdminFPTxt1"></asp:RequiredFieldValidator><br /><br />&nbsp;&nbsp;
        <asp:Label ID="Label37" runat="server" Text="Enter Password Hint : "></asp:Label>&nbsp;&nbsp;
        <asp:TextBox ID="AdminFPTxt2" runat="server" TextMode="Password"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:RequiredFieldValidator ID="AdminFPReq4" runat="server" ErrorMessage="Hint is BLANK" ForeColor="Red" ControlToValidate="AdminFPTxt2"></asp:RequiredFieldValidator><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button9" runat="server" Text="Sign Up" />&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button10" runat="server" Text="Cancel" />
    </asp:Panel>
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:ModalPopupExtender ID="ModalPopupExtender1" BackgroundCssClass="modalBackground" PopupControlID = "StaffSP" CancelControlID = "Button4" TargetControlID = "StaffSignUp" runat="server"></asp:ModalPopupExtender>
        <asp:ModalPopupExtender ID="ModalPopupExtender2" BackgroundCssClass="modalBackground" PopupControlID = "StaffFP" CancelControlID = "Button6" TargetControlID = "StaffForPwd" runat="server"></asp:ModalPopupExtender>
        <asp:ModalPopupExtender ID="ModalPopupExtender3" BackgroundCssClass="modalBackground" PopupControlID = "AdminSP" CancelControlID = "Button8" TargetControlID = "AdminSignUp" runat="server"></asp:ModalPopupExtender>
        <asp:ModalPopupExtender ID="ModalPopupExtender4" BackgroundCssClass="modalBackground" PopupControlID = "AdminFP" CancelControlID = "Button10" TargetControlID = "AdminForPwd" runat="server"></asp:ModalPopupExtender>
    </div>
    </form>
</body>
</html>

这是页面后面的代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class MasterFinal : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void LinkAdmin_Click(object sender, EventArgs e)
    {
        AdminLogin.Visible = true;
        StaffLogin.Visible = false;
    }
    protected void LinkStaff_Click(object sender, EventArgs e)
    {
        AdminLogin.Visible = false;
        StaffLogin.Visible = true;
    }
}

  ask by Parthasarthi B.K translate from so

本文未有回复,本站智能推荐:

4回复

C#后面的代码中必需的字段验证器

我试图在代码隐藏文件中使用必需的字段验证器,但它显示以下错误。 错误: 注意:TextBox1存在于页面中。 我测试过了。 Aspx Cs文件
1回复

ASP.NET必需的字段验证器和比较验证器不起作用

我的验证器都没有工作。 请帮忙! 提前致谢... 源代码如下所示:我还在Button上将CausesValidation设置为true 我正在尝试验证“保存”按钮中的控件:
1回复

必需的字段验证程序问题验证TextBox值

我有一个TextBox ,用于存储URL以应用<asp:HyperLink>控件。 我想要做的是当TextBox.Text值为空并且用户单击“ 保存”时触发RequiredFieldValidator 。 据我所知,我的逻辑是正常的,但验证器没有解雇? 这是标记:
2回复

必需的字段验证器无法通过背后的代码中的OnCheckedChanged事件进行工作

我在逻辑上做的很简单,但是却没有用。 我在文本框中有一个必填字段验证器。选择单选按钮时,必须在文本框中添加内容。 1)我尝试添加禁用的必需字段验证器,然后启用单选按钮的Onchecked更改事件,启用所需字段验证器。但这无效2)我保持必需字段验证器处于启用状态,文本框的文本为#单选按
1回复

在按钮中添加OnClientClick时,必需的字段验证器不起作用

嗨我有一个RequiredFieldValidator像这样 和这样的按钮 现在的问题是,如果我删除按钮中的OnClientClick,RequriedFieldValidator工作正常如果我把它回到那里页面帖子没有显示任何错误消息可以有人解释为什么会发生这种情况?
1回复

必填字段验证器的ControltoValidate属性[重复]

这个问题已经在这里有了答案: ASP.NET自定义验证器错误消息:无法验证属性引用的控件 2个答案 我有一个名为DynamicGenericControl的用户控件。 实际上,它从获得的属性中生成文本框,下拉列表等,并将它们作为控件添加到Page中。 例如
1回复

从.ASPX页设置必填字段验证器

我试图通过我后面的代码中的函数在所需的字段验证器控件上设置enable属性。 下面的代码似乎无法正常工作。 我想念什么? 我这样做是为了可以在验证之后测试我的代码,而不必转到所有必需的字段验证器控件来将enable属性更改为false等。
2回复

必填字段验证服务器端

我打算在按钮单击事件中触发所需的归档验证。 在我的按钮上,单击我wnat以检查所需的字段验证...任何建议?? 上面的代码对我不起作用。
2回复

必填字段验证器允许提交空白文本框

我有一个用于提交表单的两个文本框的必填字段验证器。 我的表格代码如下。 由于某种奇怪的原因,它无法验证,并允许将空字符串输入数据库。 输入的字段为char,但不会将其提交为null,而是空白。 前端 C# 编辑:忽略“插入连接字符串”部分,实际的连接字符串在与其他功能
2回复

Gridview中的必填字段验证器取决于条件c#

我在Gridview中有一个必需的字段验证器。 我仅在ddlPartsStatus为“已订购”时才触发验证器。 我就是无法正常工作。 目前,所有文本框都需要字段验证器。 我的密码 任何帮助是极大的赞赏。 谢谢