?
Solved

How do I Iterate over asp.net RepeaterControl items using Javascript -- client side.

Posted on 2010-09-09
3
Medium Priority
?
1,062 Views
Last Modified: 2012-05-10
Hi:


I have an ASP. net RepeaterControl that contains a user (.ASCX) control.
That control has a series of standard/custom validators.

From the ASPX page containing the repeater control, I'd like to be able force those
validators to "IsValid" from my aspx page -- client side. I need to do this so, the validators
on my base page will take priorty and display (while the repeater control's validators
are set to a valid state).

I would have to set "isvalid" and then update the display for the validator.
Something like this:

 function SetValidatorIsValid(id, value) {
        var cntl = $j("#[id$='" + id + "']")[0];

        if (cntl != null) {
            cntl.isvalid = value;
            ValidatorUpdateDisplay(cntl);
        }
}



I'm assuming that I would either have to iterate over the controls and validate them
individually, or write some jquery to do this.

This needs to be done CLIENT SIDE.


Can someone point me in the right direction?

Thanks,
JohnB

0
Comment
Question by:jxbma
  • 2
3 Comments
 
LVL 6

Expert Comment

by:M. Rashel Ahmed
ID: 33643265
that will be a very helpful link for you: http://aspjavascript.com/ .


0
 
LVL 1

Author Comment

by:jxbma
ID: 33643424
I need a little more concise info rather than an entire Javascript tutorial.
0
 
LVL 1

Accepted Solution

by:
jxbma earned 0 total points
ID: 33644011
I figured out a solution for this.
I added an attribute/property to all the (interesting) validators contained within my user control.
Then, when I need to set the to valid, I iterate over the controls and filter on that property.
At that point I know I have a legit validator. I set isvalid=true and redisplay the validator.

JB
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Suggested Courses
Course of the Month16 days, 13 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question