Solved

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

Posted on 2010-09-09
3
1,058 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

688 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