• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 351
  • Last Modified:

Custom Paging In User Control

Hi All

I am stuck with a scenario described below.
I have a user control for custom paging.The user control contains a dropdown and four link buttons for previous/next/first and last navigation.The dropdown contains the page size.

I have two instances of the same paging user control on the main page.The problem is when the user selects the page size from the first instance the pagesize is set in the usercontrol as dropdown.selectedvalue.

But if the user do some navigation from the second instance of the user control it will have the page size as some other value i mean the dropdown value of the second instance.

Please help me on how to achieve synchronisation.

1 Solution
It sounds like you want the page size to be the same on both controls(?) If so you can fix this in several says: (1) make the page size variable static with the 'static' keyword or (2) on the main page if the page size of one control changes, the handler method changes the value of the other control or (3) keep a static list of instances of the control and if one changes, have it automatically change the other instances.

If I've misunderstood your question (which is entirely likely!) please tell what you expect to have happen. Personally, I totally don't understand why you would want two instances of this control on one page.
manishk1111Author Commented:
The problem is solved for me where i do expose a property from the user control and set the page size on first instance and use the value for the second instance as well.No need to use even the static variable.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now