• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 581
  • Last Modified:

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:

Thanks,




<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:">
                    <InsertItemTemplate>
                        <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>
                    </InsertItemTemplate>
0
Takeoutdinner
Asked:
Takeoutdinner
1 Solution
 
Anurag AgarwalCommented:
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.


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

Validation Groups in .NET
http://www.dotnet-guide.com/validationgroups.html
0
 
TakeoutdinnerAuthor Commented:
Thank you!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now