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 7957263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:13:24+00:00 2026-06-04T04:13:24+00:00

Let me start off by saying I know how to use CausesValidation and ValidationGroup

  • 0

Let me start off by saying I know how to use CausesValidation and ValidationGroup. I have bizarre situation where I have an Ajax Tab container. Each tab has a gridview and the rows that generate in the gridviews all have a TemplateField containing an ‘Add’ button. The buttons in the gridview and tab containers all use ValidationGroup to prevent any cross contamination and all the ‘Add’ buttons are set to CausesValidation = "false"

I just added the last gridview and the ‘Add’ button triggers all validators on the page. Once more the ‘Add’ button is set as CausesValidation = "false" so there is NO reason for it to behave in this fashion. I even set this value on the front end AND in the code behind.

For attempts I have tried the suggestions in these links: “Solution 1” and “Solution 2”

Has anyone else come across this and found a solution?

Edit Request for code:
I will post only the Tab Panel in question as the whole container is almost 500 lines

<asp:TabPanel ID="tab_Browse" runat="server" HeaderText="Browse">
            <ContentTemplate>
                <table id="browseTable">
                    <tr>
                        <td>Category</td>
                        <td>
                            <asp:DropDownList ID="browseDDL" runat="server" AppendDataBoundItems="True">
                                <asp:ListItem Text="All categories" Value="999"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td>
                            <asp:Button ID="btnBrowse" runat="server" Text="Browse" ValidationGroup="vgBrowse" OnClick="btnBrowse_Click" />
                        </td>
                    </tr>
                </table>
                <asp:GridView ID="gvBrowse" runat="server" AutoGenerateColumns="false" AllowPaging="true" PageSize="8"
                    OnPageIndexChanging="gvBrowse_PageIndexChanging" DataKeyNames="foodId"
                    OnRowDataBound="gvBrowse_RowDataBound" Width="790px">
                    <Columns>
                        <asp:TemplateField HeaderText="Food ID" Visible="false">
                            <ItemTemplate>
                                <%# Eval("foodId") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Description">
                            <ItemTemplate>
                                <%# Eval("Shrt_Desc") %> (100g)
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Calories" ItemStyle-Width="50px">
                            <ItemTemplate>
                                <%# Eval("cals") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Fat Grams" ItemStyle-Width="75px">
                            <ItemTemplate>
                                <%# Eval("fat") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Carbs" ItemStyle-Width="50px">
                            <ItemTemplate>
                                <%# Eval("carbs") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ItemStyle-Width="110px">
                            <ItemTemplate>
                                <asp:Button ID="browseAdd" runat="server" CausesValidation="false" Text="Add to meal" CommandArgument="Standard" OnClick="showingEntry" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <RowStyle CssClass="gvRowStyle" />
                    <HeaderStyle CssClass="gvHeader" />
                    <AlternatingRowStyle CssClass="altRow" />
                </asp:GridView>
            </ContentTemplate>
        </asp:TabPanel>

Edit 2 Another interesting tidbit. If I put OnClientClick="alert(Page_IsValid)" on my add button it returns true even though the validators in the others tabs are triggered. if i click the button a second time it returns false and my codebehind fails as if the page posted back but skipped the OnDataBound method

  • 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-06-04T04:13:25+00:00Added an answer on June 4, 2026 at 4:13 am

    I ended up resolving this problem by preloading the gridview with an empty row. Makes no sense as to why this resolved the problem, but it does.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off, let me start by saying, I know this exact question has been
Let me start off by saying I know this is probably not the correct
Okay let me start off by saying I have been looking around a lot
Ok, let me start off by saying that I'm don't have the slightest clue
Let me start off by saying I don't want to print only the duplicate
First off, let me start by saying that I am totally new to working
Let me start off by saying, I'm using the twisted.web framework. Twisted.web 's file
First let me start off by saying I do not believe I am leaking,
To start off, let me clear the air by saying we are aware of
First let me start of saying I know absolutely nothing about c++ and I

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.