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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:31:15+00:00 2026-05-25T14:31:15+00:00

I have a nested ListView on my ASP.NET Webpage, the inner ListView has an

  • 0

I have a nested ListView on my ASP.NET Webpage, the inner ListView has an InsertItem template where I have to validate the user entries and provide warnings (using RequiredValidator and RegExpValidator and AJAX Extenders to add the call-outs). Unfortunately since the InsertTemplate is replicated for every bound item, the ValidationGroup remains the same for every independent inner ListView and the validation requires entry on all fields in all ListViews on the page, not only from the current InsertItem template.

Any idea how I can probably set the ValidationProperty to a dynamic value?

Here is (a purified and boiled-down to the problem) piece of my ASP.NET page code:

<asp:ListView ID="lstCatQualis" runat="server" ItemPlaceholderID="listQualiCats">
    </LayoutTemplate>
    <ItemTemplate>
                </tr>
                <asp:ListView ID="listQualiItems" ItemPlaceholderID="itemPlaceHolder" runat="server" DataSource='<%# Eval("Qualis") %>' InsertItemPosition="LastItem">

                  <InsertItemTemplate>
                 <tr id="quali" runat="server">
                    <td class="first">
                    </td>
                    <td class="qualirating">
                       <asp:TextBox ID="txtQualiName" runat="server" Width="250" TabIndex='1' />
                            <asp:RequiredFieldValidator ID="rv1" runat="server" ControlToValidate="txtQualiName"
                                Display="None" ErrorMessage="Bitte geben Sie Ihre Qualifikation ein."
                                ValidationGroup="quali"></asp:RequiredFieldValidator>
                            <asp:ValidatorCalloutExtender ID="vco19" runat="server" TargetControlID="rv1">
                            </asp:ValidatorCalloutExtender>
                    </td>
                    <td class="qualirating">
                       <asp:TextBox ID="txtJahreErfahrung" runat="server" TabIndex='1' />
                            <asp:RequiredFieldValidator ID="rv2" runat="server" ControlToValidate="txtJahreErfahrung"
                                    Display="None" ErrorMessage="Bitte tragen Sie die Anzhal der Jahre ein."
                                    ValidationGroup="quali"></asp:RequiredFieldValidator>
                                    <asp:ValidatorCalloutExtender ID="vco2" runat="server" TargetControlID="rv2">
                                    </asp:ValidatorCalloutExtender>
                            <asp:RegularExpressionValidator ID="ev2" runat="server" ErrorMessage="Geben Sie bitte eine Zahl ein."
                                Display="None" ControlToValidate="txtJahreErfahrung" ValidationExpression="[1-9][0-9]{0,3}"
                                ValidationGroup="quali"></asp:RegularExpressionValidator>
                            <asp:ValidatorCalloutExtender ID="vcoe2" runat="server" Enabled="True" TargetControlID="ev2">
                            </asp:ValidatorCalloutExtender>
                    </td>
                     <td class="qualilabel">
                      <asp:button ID="btnAddCatQuali" OnClick="btnAddCatQuali_Clicked" runat="server" text='Hinzufügen' TabIndex='1'  ValidationGroup="quali" />
                    </td>
                </tr>                                                          
                  </InsertItemTemplate>
                </asp:ListView>
    </ItemTemplate>
</asp:ListView>
  • 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-25T14:31:15+00:00Added an answer on May 25, 2026 at 2:31 pm

    Add an ItemDataBound event handler and inside it, search for each validator and set a ValidationGroup generated with the id of the item:

     protected void OnItemDataBound(object sender, ListViewItemEventArgs e) {
    
        var rv1 = e.Item.FindControl("rv1") as RequiredFieldValidator;
        if(rv1 != null)
           rv1.ValidationGroup = "quali" + rv1.ItemIndex;
    
     }
    

    With a recursive function you can extend the code to look for every subclass of Validator.

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

Sidebar

Related Questions

If I have a nested ListView, and I'm calling a related table in LinQ,
I have a nested GridView that is placed inside a ListView. The GridView renders
I have nested iterator in my custom stack template class. The problem I get
I am taking some code that I have used for a nested listview before
i have a nested listview, i can bind the selected item of the basic
I have a nested ListView control and within the ItemTemplate I need to make
How do I display hierarical data in ASP.NET? I have a data source that
I have nested repeaters like this: <asp:Repeater ID=rptQuestoes runat=server> <HeaderTemplate> <ol class=orderedList> </HeaderTemplate> <ItemTemplate>
I have nested while loops with a transaction in the inner loop, e.g.: WHILE
I have nested tab panels, (outer tab panel groups inner tabs), like the outer

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.