2

Ran into a bit of an issue with a site I'm currently working on. It isn't breaking anything but I would like to create a better experience for my users. What I'm attempting to do is pertain the zoom levels of the mobile device on postback. To give better context, I have a calculator that needs to do a postback and every time it reloads the page, current zoom levels get reset to default. Sadly, the original site was built for desktops but many of our sales reps are using phones/tablets to access it. One plus to this however, is that all of them are supplied with android tablets. No need for apple support so if a solution would not work for an apple device it isn't a big deal.

I know that you can prevent page zooming using meta tags, but is there a way to make the zoom levels persist over postback? If there are any ways to handle this using javascript, html, or asp.net any help would be greatly appreciated.

Edit: Found a post here talking about detecting zoom levels. May be able to use this in a viewstate variable to reset zoom on postback. Will update if solution is found.

Thanks guys

Community
  • 1
  • 1
Mr Guy
  • 140
  • 11
  • I'm not sure, but I *think* the zooming happens at application level, and isn't accessible from JavaScript. You might have better luck designing the application so that zooming is unnecessary, or building scaling into DOM with scrollbars and content scaling. I'll recommend reading into [responsive design](http://en.wikipedia.org/wiki/Responsive_web_design) and frameworks like [Bootstrap](http://getbootstrap.com/). – mason Jul 23 '14 at 15:42
  • Thank you for the response mason, I found a decent link (now put in my edit) that I may be able to incorporate somehow. If I had been the one that originally built the site I would have gone down the responsive design path, but - that is the joy of inheriting projects! Some time in the future though I would like to get it switched over. – Mr Guy Jul 23 '14 at 15:45
  • You could always built a site on the side, then detect mobile browsers and send them to the other site. Since you tagged this as ASP.NET, the [Friendly URL's](http://www.nuget.org/packages/Microsoft.Aspnet.FriendlyUrls/) package has good support for swapping between desktop/mobile views. – mason Jul 23 '14 at 15:48
  • You just gave me a decent idea... I wonder if I could throw it into an IFrame and just refresh that. If all else fails I'll look into doing it that way. Checking your link now. – Mr Guy Jul 23 '14 at 15:53
  • possible duplicate of [Changing the browser zoom level](http://stackoverflow.com/questions/1055336/changing-the-browser-zoom-level) – Mike Jul 23 '14 at 17:12

1 Answers1

0

Alright,

After a decent amount of searching, the only solution I have found seem to be a CSS zoom which I really would like to avoid. It doesn't look like you can actually modify zoom values at the browser level, which I can understand.

Link to one answer I found here.

I'm probably going to opt for using an IFrame or using mason's advice until I can get the entire site swapped over for mobile devices.

Thanks for the help guys!

Community
  • 1
  • 1
Mr Guy
  • 140
  • 11
  • If you found the answer on another question on Stackoverflow, you should close your question as a duplicate; it's cleaner than posing an answer that says "the answer is over here" – Mike Jul 23 '14 at 16:19
  • Do you need a certain rep to do this? I'm not seeing the option on the edits or flags. – Mr Guy Jul 23 '14 at 16:40
  • uh.. I know you do for other people's questions, I'm not sure about your own, if you don't have the option you can always flag a moderator for help. In this case I can vote to close it for you if you can tell me if you feel it's more of a duplicate of the "here" link, or the "advice" linked question. – Mike Jul 23 '14 at 16:42
  • "Here" link is the other answer that gave me what I was looking for. Thanks Mike. – Mr Guy Jul 23 '14 at 16:44