Solved

ASP.net Event for mobile phone flip

Posted on 2014-09-04
5
124 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

820 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