asp.net - How do you avoid duplicate items when a databound control gets bound twice? -


How do you avoid duplicated byte items in this scenario:

A database control on one page ( In this case a dropdown list, though I do not think it matters). It has an accessoryband, which is set to "true" elsewhere in the code, a datasource has been set and called databand. So this control is clearly bound.

You have a bunch of other things to force on the page, so you call the page. Databand

Your data-bound control has duplicate items in it. This (1) was clearly bound, then (2) the page Since AppendDataBoundItems was correct, the second tie adds the first time, and you repeat the items.

Some limitations:

  1. Draft on clear call control is done through some centralized code, and will be painful to change.

  2. I need to force the rest of the page to be completely (through the page. Databind ()) because many different database elements allow different calls To be written without individually.

I need a method like ... page.DatabandExceptionActiveBibleBoundDown ()

Close the offending bandwidth when you are in control. Databand () Then you page DataBind () will not rejoin the item.

  DropDownList.DataSource = Data; DropDownList.DataBind (); DropDownList.AppendDataBoundItems = Incorrect;  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -