Solved

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

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

Independent Software Vendors: 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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

713 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