Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4056464
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:49:51+00:00 2026-05-20T14:49:51+00:00

Pretend i have an existing web-site, e.g.: www.stackoverflow.com i now want to expose a

  • 0

Pretend i have an existing web-site, e.g.:

http://www.stackoverflow.com

i now want to expose a mobile version of this web-site:

m.stackoverflow.com

IIS, with its host-header name resolution, would normally require two web-sites to be created:

  • http://www.stackoverflow.com
  • m.stackoverflow.com

Except now i have two web-sites in IIS. This means i have to duplicate code/files between them. i don’t need to (nor do i want to) duplicate all the “model” and “controller” code between two web-sites. i would much rather have one web-site that exposes a mobile version.

i could have the default page in m.stackoverflow.com simply perform a redirect to a mobile landing page on the “real” web-site:

m.stackoverflow.com\default.asp:

 <% Response.Redirect "www.stackoverflow.com/mobile" %>

Then the client will end up at (for example) www.stackoverflow.com/mobile/default.aspx.

This isn’t what i want. i want it to appear to the browser that they are visiting m.stackoverflow.com.

So what i could do in IIS is have two host-header names for one IIS web-site:

  • stackoverflow.com
  • m.stackoverflow.com

and inspect the http-request HOST header:

GET https://stackoverflow.com/questions/ViewQuestion.aspx?qid=3623844
Host: stackoverflow.com

verses

GET https://stackoverflow.com/questions/ViewQuestion.aspx?qid=3623844
Host: m.stackoverflow.com

Except now my all my web-site pages must first inspect Host attribute, and then change rendering behavior depending on which it finds. This works somewhat well in classic ASP:

ViewQuestion.asp

<% Dim mobileVersion 

    ...

If MobileVersion Then
%>
<html>
...
</html>
<% Else %>
<html>
...
</html>
<% End If %>

But making dual view’s in one page is very painful. i would prefer to have a ViewQuestion view, that is dedicated to showing a regular or mobile view.


i also know that i can’t use the media=handheld media type.

  • not only do i not want to have “full” page content being sent to mobile clients (wasting their bandwidth and download speed) and then hide content based on CSS
  • not all handhelds (e.g. iPhone) honor the media=handheld media type

So what is the accepted combination of source-code and IIS configuration that best supports mobile versions of a web-site?

Edit One: Removed title reference to MVC. Don’t want people to assume the use of some particular MVC framework, since i’m not using any MVC framework. i’m using ASP/ASP.net.

See also

  • Redirect mobile devices to alternate version of my site
  • How to create mobile version of asp.NET web site?
  • Creating a mobile version of a website
  • What’s the most efficient way to hide content for a mobile version of a site?
  • A Better ASP.NET MVC Mobile Device Capabilities ViewEngine
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T14:49:52+00:00Added an answer on May 20, 2026 at 2:49 pm

    In mvc you can just submit mobile views by overriding the view engine. We created an iphone version of our site in about 3 days.

    http://www.hanselman.com/blog/ABetterASPNETMVCMobileDeviceCapabilitiesViewEngine.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Pretend you have a button on an iOS GUI. Pressing this button should now
Let's say I have a file like this (pretend it were a matrix): abcde
Let's say you're implementing your own version of stackoverflow (once again, yes) You have
Let's pretend I have a project directory that isn't a git repository. This project
Let's pretend I have a large recipe-database. A table for recipes each with an
i have a form, which you can pretend is laid out like Windows Explorer:
I have an ASP.NET application that uses themes. Let's pretend I have a theme
I'm going to give this another try because my last question might have been
I want to insert TAB characters inside a TEXTAREA, like this: <textarea>{KEYPRESS-INSERTS-TAB-HERE}Hello World</textarea> I
Lets pretend you have a 3 Gb jar file and your application only uses

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.