Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4063936
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:47:27+00:00 2026-05-20T15:47:27+00:00

Using VS 2008, I have a Repeater control with nested elements and want to

  • 0

Using VS 2008, I have a Repeater control with nested elements and want to select one of them (the checkboxes) with jquery.

<asp:Repeater runat="server" ID="storesRep" DataSourceID="storeSqlDataSource" OnItemDataBound="StoresRep_ItemDataBound">
        <ItemTemplate>
            <table style="padding:0px">
            <tr>
                <td style="width:200px"><asp:Label ID="infoLbl" runat="server">Choose stores for upload:</asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;</td>
                <td style="width:110px"><asp:Label ID="storeLbl" runat="server" Text='<%# Bind("Name") %>'></asp:Label>&nbsp;&nbsp;</td>
                <td><asp:CheckBox runat="server" ID="storeCheck" CssClass="storeCheck" /></td>
            </tr>
            </table>
        </ItemTemplate>
        <FooterTemplate>
            <table runat="server" id="footerTbl" visible="false" style="padding:0px">
                <tr>
                    <td style="width:200px"><asp:Label ID="infoLbl" runat="server">Choose stores for upload:</asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;</td>
                    <td><asp:Label ID="lblEmptyData" Text="No Stores found." runat="server" ForeColor="GrayText"></asp:Label></td>
                </tr>
            </table>        
         </FooterTemplate>
    </asp:Repeater>

Here is my script

$('#<%= uploadBtn.ClientID %>').click(
    function() {

        //check if store was chosen from list
        var storeChecked = false;
        $('#<%= storeCheck.ClientID %>').each(function() {

            if ($(this).attr('checked'))
                storeChecked = true;
        });
        if (storeChecked == false) {
            alert("Upload is only possible if a store has been chosen from list.");
            return false;
        }

I get the compiler error “storeCheck is not a known name in the current context”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T15:47:28+00:00Added an answer on May 20, 2026 at 3:47 pm

    It’s not working because you are trying to access storeCheck using it’s ID and storeCheck only exists in the context of the repeater.

    What you should do is use the class instead. So change:

    $('#<%= storeCheck.ClientID %>').each(function() {
    

    to

    $('.storeCheckBox').each(function() {
    

    You can also change you code to this which just checks if there are any checked checkboxes with the class of storeCheck:

    $('#<%= uploadBtn.ClientID %>').click(function() {
        if($('span.storeCheck input:checked').length == 0) {
            alert("Upload is only possible if a store has been chosen from list.");
            return false;
        }
    });
    

    Changed the code as it appears that asp.net puts the checkbox inside a span with the class you supply rather than applying it straight to the checkbox.

    jsfiddle – http://jsfiddle.net/infernalbadger/rAVLA/1/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using VS 2008, I have a Repeater control: <asp:Repeater runat=server ID=storesRep DataSourceID=storeSqlDataSource OnItemDataBound=StoresRep_ItemDataBound> <ItemTemplate>
While working with ASP.NET using Visual Studio (2008) I have discomfort issue: source code
I'm using visual studio 2008 I have a control that dispays a processed image.
Using VisualStudio 2008, have emacs keyboard mapping scheme enabled. If I select text and
I am currently using Windows Server 2008 Standard and have several Hyper V machines.
I have an access database with 3 tables. People Gifts PeopleGifts Using VS 2008,
I have created a setup project using Visual Studio 2008. After the application is
Using Visual Studio 2008 / C# / VS Unit Testing. I have a very
I'm using SQL Server 2008 Management studio viewing a 2005 server and have just
I'm making a winform in C# using Visual Studio 2008. Currently, I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.