2

Best Practice of making a Composite Control with a repeater activity

It's Templated-Based, have paging support via a DropDown and 2 Buttons It should have Event-Handling also Needed to work as a package for ( so didn't want to give template-editability or much programming options )

Key Parts to answer :

  1. A Custom Repeater, A Composite Control , A Custom Control with functionality similar to repeater or CompositeDataControl?
  2. How prepare and get the data to avoid repetition of the processes I did all controls creation and initiation in CreateChildControls
    but seems that it is running in every request, Is it good to let all the controls created on every Postback or We have to Control this process, How do you suggest

  3. Cause we want to Bind via the repeater should we do anything regarding of Data Binding inside the Composite Control ? In my example I binded the repeater (just the repeater) in a method that will run in each run in every serious event like OnLoad (Conceptually we binded the repeater, not the CC)

  4. How to make a property such as Page Number persistent via postbacks use viewStates or if any click we pass the new Page info from session to the control it should do the job ? What is your Paging Strategy, In simple Lines

  5. Should I store anything of the Repeater in ViewState/Control State and assign a property for them ?

want to know your decision, best-practice other professionals know and suggest

Kasrak
  • 133
  • 6

1 Answers1

1

Though this is not a comprehensive answer for your question. But if you disable view state, then event handling for components inside the repeater will stop working. I did write a blog post about it, and a workaround for that problem. http://petesdotnet.blogspot.com/2009/08/asp.html

Pete
  • 8,916
  • 3
  • 41
  • 53
  • Thanks Pete, I will look at it, maybe it points to a part of the question, and anyway it's appreciated – Kasrak Jun 02 '12 at 07:46