0

Sorry in advance if this is not the right place to ask this.

I have a task of making a asp.net site into responsive. The site consists of various ASP.NET controls as well as Telerik ones. The problem is that the designs that i have for the mobile view do not comply with the current structure of site, so in many occasions i have to put the same control twice in the same page, and the hiding/showing depending on the width of the screen.

So i did my research and found that only unique IDs are permitted in same page. Is there any alternative to have the same control twice in same page?

mathew
  • 185
  • 4
  • 20
  • Do these two controls ever have to be shown at the same time? If not why don't you work out which control is needed before you render the page and only include that one. However If the window is resized you would have to use ajax to replace the control with the other one. – user2945722 Nov 24 '15 at 15:36

1 Answers1

0

No, there isn't. Controls' IDs must be unique.

Perhaps wrapping them in user control instances and using those a few times over and exposing public properties for what you need is one approach.

Consider using tools like RadPageLayout that help you hide/move unwanted controls/pieces of the page: http://docs.telerik.com/devtools/aspnet-ajax/controls/pagelayout/overview.

Or, create helper methods that get the needed user input/control depending on what is visible or not. These could even be properties in your page that return the currently visible control so you can set properties, data sources, get input, etc. With this you will reference the duplicated controls via this property rather then via their instance ID. Tough to maintain, but without completely redesigning your page and needing duplicates I am not sure there is much else you can do.

rdmptn
  • 5,413
  • 1
  • 16
  • 29