Takeoutdinner
asked on
Skip <asp:RequiredFieldValidator
Hi experts,
I have MasterPage and SubPage. And SubPage has "<asp:RequiredFieldValidat or ".
Using Hot Key In MasterPage, I try to go another screen without "<asp:RequiredFieldValidat or ".
How can I skip this "<asp:RequiredFieldValidat or "?
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.SelectedValu e.ToString ();
Response.Redirect("~/AddEd itPost.asp x?ForumID= " + myForumID);
}
<asp:TemplateField HeaderText="Name:">
<InsertItemTemplate>
<asp:TextBox ID="txtAddedBy" runat="server" Text='<%# Bind("AddedBy") %>' Width="99%"></asp:TextBox>
<asp:RequiredFieldValidato r ID="valRequireAddedBy" runat="server" ControlToValidate="txtAdde dBy"
Display="Dynamic" ErrorMessage="RequiredFiel dValidator " SetFocusOnError="True">You r name is required.</asp:RequiredFie ldValidato r>
</InsertItemTemplate>
I have MasterPage and SubPage. And SubPage has "<asp:RequiredFieldValidat
Using Hot Key In MasterPage, I try to go another screen without "<asp:RequiredFieldValidat
How can I skip this "<asp:RequiredFieldValidat
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.SelectedValu
Response.Redirect("~/AddEd
}
<asp:TemplateField HeaderText="Name:">
<InsertItemTemplate>
<asp:TextBox ID="txtAddedBy" runat="server" Text='<%# Bind("AddedBy") %>' Width="99%"></asp:TextBox>
<asp:RequiredFieldValidato
Display="Dynamic" ErrorMessage="RequiredFiel
</InsertItemTemplate>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just set the Visible property to false.
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
Validation Groups in .NET
http://www.dotnet-guide.com/validationgroups.html
ASKER
Thank you!