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 209023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:52:41+00:00 2026-05-11T17:52:41+00:00

I’m trying to find a way to to do something that I think must

  • 0

I’m trying to find a way to to do something that I think must be possible but I’m just missing the point on – so hopefully someone can give me a bit of a nudge 🙂

I’m utilising databinding in ASP.NET (viewstate turned off – so using controlstate for a few things here and there) to render a repeater (repeaterPriceClasses) that has a repeater within each itemtemplate (repeaterPriceBands). Basically this renders a table out of some text and a dropdownlist in each cell.

I’m trying to find a way to enumerate the repeaterOuter inside the event handler of a button to give me a list of all of the originally bound elements that have now got a dropdownlist with a value of >0, along with what that value is.

public Dictionary<Price, int> SelectedPrices
{
    get
    {
        var sel = new Dictionary<Price, int>();
        foreach(RepeaterItem itemClass in repeaterPriceClasses.Items)
        {
            var repeaterPriceBands = itemClass.FindControl("repeaterPriceBands") as Repeater;

            foreach(RepeaterItem itemBand in repeaterPriceBands.Items)
            {
                var context = (Price)itemBand.DataItem;
                var listQty = itemBand.FindControl("listQty") as DropDownList;

                if(listQty.SelectedValue.ToInt32() > 0)
                {
                    sel.Add(context, listQty.SelectedValue.ToInt32());
                }
            }
        }
        return sel;
    }
}

Now this fails because the itemBand.DataItem is always null after databinding has finished.

What technique should I use to get around this?

  1. Hidden field with primary keys in it
    (not ideal as can be abused and adds
    weight to the page)

  2. Lookup from
    original cached data based on indexes
    (just seems wrong)

  3. or something
    else/better…?

EDIT: Is there any more information that I could provide to help this get answered?

  • 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-11T17:52:42+00:00Added an answer on May 11, 2026 at 5:52 pm

    You can try adding extra attributes to your HTML elements in the ItemDataBound event when DataItem is available.

    ddlSomething.Attributes["Attribute1"] = dataItemObject.PropertyName;
    

    [Edit]
    Apart from using attributes, you can render some array containing JSON objects like this, for each row.

    var repeaterItemAttributes = [ { Prop1: val1, Prop2: val2, ... }, { ... }, ... ]
    

    So, by using this, you won’t have to render the attributes, and your code will be XHTML compliant too (tho its not required). You can then loop through the object array and read any property you like. You can also apply the light encryption you were talking about to the property values.
    [/Edit]

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

Sidebar

Related Questions

I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to create an if statement in PHP that prevents a single post
Seemingly simple, but I cannot find anything relevant on the web. What is the
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.