Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3722836
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T06:03:03+00:00 2026-05-19T06:03:03+00:00

I have a page with the following mark up <%@ Page Title= Language=C# MasterPageFile=~/CaseAdmin.master

  • 0

I have a page with the following mark up

<%@ Page Title="" Language="C#" MasterPageFile="~/CaseAdmin.master" AutoEventWireup="true" CodeBehind="AddExhibit.aspx.cs" Inherits="Prototype5.AddExhibit" %>

    <h2 class="style2">
    <strong><span style="color: #FFFFFF">Add Exhibit
    Form</span></strong></h2>
<div style="width: 600px">
<table style="width: 303px" align="left">
        <tr>
            <td class="style26" style="background-color: #666666">
                <p class="style5" style="color: #000000; background-color: #666666;">
                    <strong style="background-color: #666666">Select Existing Case ID:    
                </strong>    
                </p></td>
            <td class="" style="background-color: #C0C0C0" align="left">
                <asp:DropDownList ID="DropDownListcaseid" runat="server" 
                    onselectedindexchanged="DropDownListcaseid_SelectedIndexChanged">
                </asp:DropDownList>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="DropDownListcaseid" 
                    ErrorMessage="Please select a valid case id from the dropdown menu" 
                    ForeColor="Red">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style4" colspan="2">
                &nbsp;</td>
        </tr>
    </table>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:CMSSQL3ConnectionString1 %>" 
        SelectCommand="SELECT [CaseID] FROM [Cases]"></asp:SqlDataSource>

</div>
<div style="width: 603px; height: 75px; ">

    <table style="height: 66px; width: 598px; top: 277px; left: 268px;" 
        align="left">
        <tr>
            <td class="bold" 
                style="color: #000000; background-color: #666666; width: 127px;">
                <strong>Exhibit Type</strong></td>
            <td class="bold" style="background-color: #666666; width: 228px;">
                <span style="color: #000000">Exhibit Image</td>
            <td class="bold" style="background-color: #666666; width: 111px;">
                <span style="color: #000000">Stored Location</span></td>
            <td class="bold" style="background-color: #666666; color: #000000;">
                Officer ID</span></td>
        </tr>
        <tr>
            <td class="style32" style="background-color: #C0C0C0; width: 127px;">
                <asp:DropDownList ID="exhibitTypeDropDownList" runat="server">
                    <asp:ListItem></asp:ListItem>
                    <asp:ListItem>Hard Disk</asp:ListItem>
                    <asp:ListItem>Pen Drive</asp:ListItem>
                    <asp:ListItem>Laptop</asp:ListItem>
                    <asp:ListItem>Palm Devce</asp:ListItem>
                    <asp:ListItem>Mobile Phone</asp:ListItem>
                    <asp:ListItem>Tablet PC</asp:ListItem>
                    <asp:ListItem>Pager</asp:ListItem>
                </asp:DropDownList>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="exhibitTypeDropDownList" 
                    ErrorMessage="Please Enter the type of exhibit. eg. Harddisk" 
                    ForeColor="Red" ondisposed="addExhibitButton_Click">*</asp:RequiredFieldValidator>
            </td>
            <td class="style28" style="background-color: #C0C0C0; width: 228px;">
                <asp:FileUpload ID="exhibitImageFileUpload" runat="server" />
            </td>
            <td class="style20" style="background-color: #C0C0C0; width: 111px;">
                <asp:DropDownList ID="storedLocationDropDownList" runat="server">
                    <asp:ListItem></asp:ListItem>
                    <asp:ListItem>B-15/4</asp:ListItem>
                    <asp:ListItem>B-10/1</asp:ListItem>
                    <asp:ListItem>B-5/4</asp:ListItem>
                </asp:DropDownList>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ControlToValidate="storedLocationDropDownList" 
                    ErrorMessage="Please enter a valid stored location" ForeColor="Red" 
                    ondisposed="addExhibitButton_Click">*</asp:RequiredFieldValidator>
            </td>
            <td class="style30" style="background-color: #C0C0C0">
                <asp:DropDownList ID="DropDownList1" runat="server" 
                    DataSourceID="officersSqlDataSource" DataTextField="PoliceID" 
                    DataValueField="PoliceID" Width="79px" Height="26px">
                </asp:DropDownList>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                    ControlToValidate="DropDownList1" 
                    ErrorMessage="Please select a valid Officer id from the dropdown list" 
                    ForeColor="Red" ondisposed="addExhibitButton_Click">*</asp:RequiredFieldValidator>
            </td>
        </tr>
    </table>

</div>
<div style="width: 609px; height: 23px;">
                </div>
<div style="margin-top:12px; width: 232px; text-align:left; font-size:1.3em;">

    <asp:SqlDataSource ID="officersSqlDataSource" 
        runat="server" 
        ConnectionString="<%$ ConnectionStrings:CMSSQL3ConnectionString1 %>" 
        SelectCommand="SELECT PoliceID FROM PoliceOfficers"></asp:SqlDataSource>
    <table align="left">
        <tr>
            <td align="center">
                <asp:ValidationSummary ID="ValidationSummary1" runat="server" ForeColor="Red" 
                    HeaderText="The following errors occured." />
            </td>
        </tr>
    </table>

    </div>
    <div style="margin-top:12px; width: 456px;">

        <table  style="width: 450px" align="left">
            <tr>
                <td align="center" colspan="3">
                    <asp:Label ID="messageLabel" runat="server" BackColor="White" ForeColor="Red" 
                        Visible="False"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="center" style="width: 96px">
                    <asp:Button ID="cancelButton" runat="server" Text="Cancel" 
                        onclick="cancelButton_Click" height="26px" width="101px" />
                </td>
                <td  style="width: 237px">
                    &nbsp;</td>
                <td align="center">
                    <asp:Button ID="addExhibitButton" runat="server" Text="Add Exhibit" 
                        onclick="addExhibitButton_Click" />
                </td>
            </tr>
        </table>

    </div>

and the following interface look
alt text

I wish to perform validation on the page only when the “add exhibit button” is clicked. so in my code behind, i used an “if(page.isvalid)” to check for page validation when the button is clicked. However any other button i click fires the validation as well… I presume its because every button click tries to load a page and that calls the validator to action. how do i allow work around the validation such that, only the ” add exhibit button” triggers the page validation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T06:03:04+00:00Added an answer on May 19, 2026 at 6:03 am

    You need to set the ValidationGroup property on the button and the validator. That way you can control what validation takes place.

    The ValidationGroup property is an arbitrary tag that you can add to your validators and buttons to group them into logical units. So in your case, I would do this:

    For your validators that are relevant for the add exhibit action.

    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" ValidationGroup="AddExhibit" ...
    

    For your button that triggers your add exhibit.

    <asp:Button ID="addExhibitButton" ValidationGroup="AddExhibit"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a master page which references a style in the following manner: <link
I have a master page with tabs. The tabs are defined by the following
I have the following models: class Mark < ActiveRecord::Base validates_presence_of :user validates_presence_of :page belongs_to
I have the following page: <!DOCTYPE html> <html> <head> <meta charset=utf-8> <title>Title</title> <link rel=stylesheet
I have a page with the following two divs: <div id=searchResults> </div> <div class=postSearchOptions
What is the best method of doing the following: I have Page A with
I have a search page with the following scenarios listed below. I was told
I have the following ASP page: <asp:Content ID=Content2 ContentPlaceHolderID=ShellContent runat=server> <form runat=server id=AddNewNoteForm method=post>
I have the following scenario. I have a index.php page with the following JQuery
i have following code to show div on page <div id=all_users> <div id=user11 userid=11

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.