Solved

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

Posted on 2010-09-09
3
1,052 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

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…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

785 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