Solved

ASP.net Event for mobile phone flip

Posted on 2014-09-04
5
122 Views
Last Modified: 2014-09-08
Hi

I have a standard website application in ASP.net. Is there a way to trigger code when a mobile device is flipped 90 degrees, in other words from a Microsoft portrait view to a landscape view
0
Comment
Question by:murbro
  • 2
  • 2
5 Comments
 
LVL 12

Assisted Solution

by:Ammar Gaffar
Ammar Gaffar earned 200 total points
ID: 40303252
Hi,
As I know, only client side code can do that, if you are using jQueryMobile in your asp.net application then visit this link:
http://api.jquerymobile.com/orientationchange/

Good Luck
0
 
LVL 12

Expert Comment

by:Ramkisan Jagtap
ID: 40303300
$(window).on("orientationchange",function(){
  alert("The orientation has changed!");
});
0
 

Author Comment

by:murbro
ID: 40303430
Hi
I should have mentioned that my ASP.net project uses VB.net code.
Thanks Ramkisan. Where would the code (which I assume is JavaScript) go
0
 
LVL 12

Accepted Solution

by:
Ramkisan Jagtap earned 300 total points
ID: 40305087
Hi Murbro,

You can include this code on top or bottom of the aspx page.

<script type="text/javascript">
$(window).on("orientationchange",function(){
   alert("The orientation has changed!");
 });
<script>
0
 

Author Closing Comment

by:murbro
ID: 40310722
Thank you both
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now