Solved

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

Posted on 2010-09-09
3
1,048 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
Comment Utility
that will be a very helpful link for you: http://aspjavascript.com/ .


0
 
LVL 1

Author Comment

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

Accepted Solution

by:
jxbma earned 0 total points
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
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 …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now