Skip <asp:RequiredFieldValidator

Hi experts,

I have MasterPage and SubPage. And SubPage has "<asp:RequiredFieldValidator ".
Using Hot Key In MasterPage, I try to go another screen without "<asp:RequiredFieldValidator ".
How can I skip this "<asp:RequiredFieldValidator "?
Please refer to my codes for this:


<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Add New" />
    protected void Button1_Click(object sender, EventArgs e)
        string myForumID = ddlCategories.SelectedValue.ToString();
        Response.Redirect("~/AddEditPost.aspx?ForumID=" + myForumID);

               <asp:TemplateField HeaderText="Name:">
                        <asp:TextBox ID="txtAddedBy" runat="server" Text='<%# Bind("AddedBy") %>' Width="99%"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="valRequireAddedBy" runat="server" ControlToValidate="txtAddedBy"
                            Display="Dynamic" ErrorMessage="RequiredFieldValidator" SetFocusOnError="True">Your name is required.</asp:RequiredFieldValidator>
Who is Participating?
Anurag AgarwalConnect With a Mentor Commented:
hi buudy !!
Just open the  master page which has the button on which u have set a hot key just set the proferty
Causes validation = False for that button or control in master page.

Just set the Visible property to false.
Bob LearnedCommented:
Another possibility is to define validation groups, which gives you control over how things are validated:

Validation Groups in .NET
TakeoutdinnerAuthor Commented:
Thank you!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.