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

  • SEARCH
  • Home
  • 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 8666017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:37:33+00:00 2026-06-12T17:37:33+00:00

ASP.Net 4.5 introduces new ways to bind data to controls like the Repeater through

  • 0

ASP.Net 4.5 introduces new ways to bind data to controls like the Repeater through the SelectMethod property:

<asp:Repeater runat="server" ItemType="MyData.Reference" 
      SelectMethod="GetReferences">

calls the Codebehind method

public IEnumerable<Reference> GetReferences()

In the scenario of nested repeaters, is it possible to pass a parameter to this select method somehow, so that it fetches different data depending on the Item of the outer repeater?

Example:

<asp:Repeater runat="server" ItemType="MyData.Reference" 
        SelectMethod="GetReferences(Item.ID)">

should be calling

public IEnumerable<Reference> GetReferences(int id)

I know this can be achieved through ItemDataBound events, but I would like to use the much simpler and cleaner syntax of SelectMethod and ItemType.

Does the SelectMethod allow parameter passing somehow?

If not, is there another clean way to get the value from the outer Repeater Item within my SelectMethod?

  • 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-06-12T17:37:34+00:00Added an answer on June 12, 2026 at 5:37 pm

    While waiting for answers, I played around a bit and found the following solution.

    It might not be the best way to do it, but so far I have found no problems with it and it’s pretty straigtforward, so I’ll just throw it out there.

    <asp:Repeater runat="server" ItemType="MyData.Reference" 
         DataSource='<%# GetReferences(Item.ID) %>'>
    

    Essentially what I do here is replace the SelectMethod with DataSource (Intellisense will not suggest it, but it works nonetheless).

    This way I can pass a value to the GetReferences method and then uses the return value for model binding.

    So far this is the shortest solution I came across.

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

Sidebar

Related Questions

ASP.NET 4.5 introduces strongly typed data controls . From what I could gather there
I know why runat=server is currently required ( ASP.NET why runat=server ), but the
So I'm trying to introduce some caching into my Asp.Net application. New data for
In ASP.NET MVC 2, a couple of new action filter attributes were introduced, as
ASP.NET MVC 2 will support validation based on DataAnnotation attributes like this: public class
ASP.NET AJAX 4 recently added the ability to track changes to ADO.NET Data Services
I am developing an ASP.NET MVC app and I've been looking into using Data
please introduce some form maker(page maker) for asp.net. like Iron speed. that enable us
This question is for ASP.NET and SQL Server developers. What are your best practices
I'm new to developing web apps using ASP.NET MVC. In fact, I'm rather new

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.