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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:00:34+00:00 2026-06-13T21:00:34+00:00

I have a ListView <asp:ListView ….> <asp:TextBox ID=txtComment … /> <asp:RequiredFieldValidator ID=rfvComment ControlToValidate=txtComment …

  • 0

I have a ListView

<asp:ListView ....>
    <asp:TextBox ID="txtComment" ... />
    <asp:RequiredFieldValidator ID="rfvComment" ControlToValidate="txtComment" ... />
    <act:ValidatorCalloutExtender ID="vceComment" TargetControlID="rfvComment" ... />

    <asp:Button ID="btnAddComment" ... />

</asp:ListView>

lets say this ListView creates the following:

TextBox1
Button1

TextBox2
Button2

TextBox3
Button3

If I click on Button2 the RequiredFiledValidator/ValidatorCalloutExtender are applied to TextBox1 instead of TextBox2, if I click on Button3 the RequiredFiledValidator/ValidatorCalloutExtender are applied to TextBox1 as well, I want the RequiredFiledValidator/ValidatorCalloutExtender to apply to the TextBox next to the button, so if I click Button3 I want it to apply to TextBox3.

Does anyone know how can I achieve this?

thank you.

  • 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-13T21:00:36+00:00Added an answer on June 13, 2026 at 9:00 pm

    Use ValidationGroup property and generate it value dynamically:

    <asp:TextBox runat="server" ID="TextBox1" />
    <asp:RequiredFieldValidator runat="server" ControlToValidate="TextBox1" Text="*"
        ValidationGroup='<%# "validationGroup_" + Container.DataItemIndex.ToString() %>' />
    <asp:Button runat="server" Text="Click Me" ValidationGroup='<%# "validationGroup_" + Container.DataItemIndex.ToString() %>' />
    

    Add script below at very bottom of form:

    <script type="text/javascript">
        var originalValidatorUpdateDisplay = ValidatorUpdateDisplay;
        ValidatorUpdateDisplay = function (val) {
            originalValidatorUpdateDisplay.call(null, val);
            var isHidden = val.style.display == "none" || val.style.visibility == "hidden";
    
            var extender = Sys.UI.Behavior.getBehaviorsByType(val, Sys.Extended.UI.ValidatorCalloutBehavior);
            if (extender && extender.length == 1) {
                extender = extender[0];
                if (isHidden) {
                    extender.hide();
                }
                else {
                    extender.show(true);
                }
            }
        }
    </script>
    

    I suppose it would be better to customize toolkit source, but I’m not in the mood to do this 🙂 So hope this script will fix your problem

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

Sidebar

Related Questions

I have a setup, something confusing like this: <ListView> <ItemTemplate> <div id=Content> <asp: TextBox
Say I have a ListView control with a TextBox control in the ItemTemplate: <asp:ListView
I have a ListView in my aspx file like this: <asp:ListView ID=ListView1 runat=server></asp:ListView> and
I have an asp:ListView control on an ASP.NET page. It is bound to an
I have an ASP ListView, and have a very simple requirement to display numbers
I have ListView that has the following EditItemTemplate: <EditItemTemplate> <tr style=> <td> <asp:LinkButton ID=UpdateButton
I have trouble getting a custom ObjectDataSource for an asp:ListView control to work. I
For example, i have this ImageViewer.ascx UserControl: <div class=ImageTumbnails> <asp:ListView ID=ImageList runat=server ItemPlaceholderID=ItemContainer> <LayoutTemplate>
I have an ASP.NET 2.0 ListView control (aka:parent) and configured inside this ListView I
I have an ASP.Net site, in which I am using a ListView with a

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.