Setting Chrome to render ASP.Net mobile - asp.net

I am using the functionality in ASP.Net where it detects if the browser is on a mobile device and redirects to the page that has *.mobile.cshtml. This is all working great as long as I'm actually using a mobile device, but I can't seem to figure out how to get Chrome or Firefox to use the *.Mobile.cshtml files instead of the standard .cshtml files.
I've tried setting the Chrome emulation to use iPhone, but it is still rendering my standard pages.
Is there some setting in VS or Chrome that will tell ASP.Net to render the mobile version?

Related

404 error - File or directory not found. This is happening with certain pages when using Chrome Web Browser

I've been hired into a company that uses ASP.NET for all of their external and internal sites. I'm not too familiar with ASP.NET.
I'm currently working on a external site that runs perfectly in Internet Explorer.
When using the site on chrome, I have certain pages that give me the 404 - File or directory not found.
What can I do to help prevent this error code from showing up when using this site the chrome?
From your description, I understand that your site is a legacy site that is compatible with the IE browser but it is not working properly with modern browsers.
The 404 error information generally informs us that something is not found but if the site works fine in the IE browser then it could be possible that the issue is something else. In that case, this is too little information to predict the cause of the issue.
You may need to provide detailed information about which exact piece of code has the issue. Which version of the Asp.Net project and which kind of project(Web application, web API, etc.) it is. You may need to modify your code or project to make it work with modern browsers including Google Chrome.
At present, if you don't want to make any changes in your code then you could try to use the IE mode in the MS Edge browser to load your legacy site.
You could configure the IE mode manually or using the group policy.
To quickly check it, Launch the Edge browser. Paste edge://settings/defaultBrowser in the address bar and press the Enter key. Add your page to the Internet Explorer mode pages. Visit your site, it should load properly in the IE mode in the Edge browser.

Visual Studio / Mobile Switcher Does Not Use Correct .CSS When Switching Between Desktop and Mobile Sites

Here is the requirement:
The application is developed in Visual Studio 2015. It has a responsive (bootstrap) UI and is developed in VB.NET. The application has two sets of .aspx pages: one for the main application (works great) and a second for the mobile application (also works great).
When the user logins in using a desktop/tablet, they are correctly redirected to the 'desktop' version of the site including the correct Site.Master and CSS. Clicking the 'ViewSwitcher' on a desktop correctly directs the user to the mobile site SiteMobile.Master and correct CSS. So the desktop works correctly in terms of detecting the device and directing the user. No issue there.
If Request.Browser.IsMobileDevice = True Then
Response.Redirect("~/Mobile/index.aspx")
Else
Response.Redirect("~/AccessSecurity/Dashboard.aspx")
End If
When the user accesses the application using a phone (Chrome, IE, Firefox, etc) the same code directs the user to the mobile version of the application. Great. Again, no issue.
But here is the problem. When the user accesses the application using a mobile and wants to switch to the desktop version, the switcher directs them to the correct page, however the mobile CSS is used (the one referenced in the SiteMobile.Master) and not the one referenced by the Site.Master. No matter what I do, I cannot get the application to use the correct CSS from a phone when switching from Mobile to Desktop view. Here's what I've tried:
I've tried to force the page.masterfile on pre_init
I've moved the SiteMobile.Master to a directory called "MobilePages" to get it out of the root directory of the project. The compiler did not like this and wants the file in the root directory of the Visual Studio projectFrown | :(
and so on...
So the issue again is only when using a mobile device that switching to desktop view (Site.Master) it retains the mobile css even though the mobile css is not referenced by site.master.
Boy, I really hope I've explained this correctly!
Any insight/experience you've had would be appreciated.
Cory

Create custom splash screen in Firefox OS application

After developing an application, Firefox OS automatically creates a splash screen for the app using the app icon. But for my application I want to develop a custom splash screen.
It is possible using JavaScript methods like But firefox setTimeOut or setInterval, but Firefox OS doesn’t support these types of methods.
You can create 2 pages and after your desired time, just switch to another page using javascript. You should put the first page in manifest.

how you can change the style of the page without changing CSS files?

How would you go about changing the appearance of a website say when demonstrating a website to a client without going directly into the css files and editing it.
For the purpose of an interactive styling session when as a customer we need little tweaks to the site as its in discussion.
I don't see a better way than using the Web Inspector or Chrome DevTools
Web Inspector
The Web Inspector gives you quick and easy access to the richest set
of development tools ever included in a browser. From viewing the
structure of a page to debugging JavaScript to optimizing performance,
the Web Inspector presents its tools in a clean window designed to
make developing web applications more efficient. To activate it,
choose Show Web Inspector from the Develop menu.
Safari Web Inspector - Styles
Common Browsers
Safari - Safari Web Inspector - Styles
Chrome - Chrome DevTools
Opera - Dragonfly

2 servers, same website on both: IE shows two slightly different version

I'm getting a weird issue involving IIS and IE, and I'll try to describe it clearly.
I have a regular html-css-js/jquery website that I've developed locally. Now that it's ready, I'm trying to deploy it on a server.
Once it's hosted on the server, I see two problems in IE only:
The rendering is slightly different: there's a few pixels of additional white space all around my website (so the contents is actually more 'compressed' than when viewed locally).
Some JS issues: I'm using the Impromptu jQuery popup plug-in, and the callback I specify in its 'loaded' event pre-populates its forms fields. In FF it works, but in IE the fields don't get populated until I close the popup and open it again. This worked locally on all browsers.
As weird as it sounds, the text in my jQuery popup dialog does not seem to have the 'ClearType' technology applied. The text is like '1 pixel thin' and not anti-aliased like everywhere else.
I have uploaded my website to another server and it runs perfectly fine. The issue is that I need to put it on the first server and I don't know what's wrong. Both servers are on Win 2k3 with IIS 6, .NET 3.5.
Any pointers as to what is going wrong? Thanks a lot.
Make sure that the "security zone" in the Internet Explorer status bar is the same when viewing the site between the 2 servers.
Use the IE developer toolbar to debug your css. Could also be a caching issue if it looks like an older version.
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=95e06cbe-4940-4218-b75d-b8856fced535

Resources