Testing ASP.NET Web Application in iPhone Simulator available in Safari browser

Once the web application development is done, next task is to test the asp.net web application in different Mobile devices. Now we will see how to test our asp.net web application in iPhone using Safari Browser.

Install the Safari Web browser. Safari web browser is freely available, and you can download it from the below link.


Now launch the Safari browser. By default, the Menu Bar will be hidden. Enable the menu bar, by selecting Settings->Show Menu Bar, as shown in the below figure.

                                            show menu bar

Now again select Settings –> Preferences… option as shown in the below figure.


It will invoke the Preferences dialog. In this dialog, select Advanced tab and check the option “Show Develop menu in menu bar”, as shown in the below figure.

                                           developer option

Close the Preferences dialog. Now Develop menu will be available in the menu bar.

Select the Develop—>User Agent –>Mobile Safari 4.0.2 – iPhone option as shown in the below figure. Now the displayed website will be as it displayed in the iPhone.

User agent - iphone

Check the below figure, how the Citibank Mobile site is displayed in the Safari browser.

                                                           citi Mobile


NOTE: You can test your web application in iPad mode by selecting iPad option from the User Agents.

You are done. Happy Testing!!!

8 thoughts on “Testing ASP.NET Web Application in iPhone Simulator available in Safari browser

  1. Thanks for all your posting.
    I have a question can I detect the landscape position on iPhone from C# code behind.
    The reason I ask is because my site will have a background image and the text has to be in a exaclly position, so I need to redirect to another page when in landscape posion on be able to replace the image.

    1. Hi Marcia,
      You can detect Orientation only with Javascript. You can’t detect it in the C#.NET code.
      Check the below link for detecting iPhone Orientation using JavaScript.

      You can still achieve ur goal with Javascript. Once it detects the Landscape Mode, then use the the following code to redirect to different page.

  2. Hello,
    Can I test a website containing silverlight on Ipad simulator .
    when I checked User Agent to IPAD os and and start browsing website it was loading silverlight bu in real scenrio silverlight is not supported by IOS . Can you please explan his.


    1. Hi,
      If you have developed a specific web app for Apple iPhone/iPad, then the changing of UserAgent will help you to see the display on the web app on the particular device. In your case, Apple Safari browser(Desktop) supports Silverlight where as Apple Mobile Safari browser doesn’t.

      Hope it helps u…

  3. Hey There. I found your blog using msn. This is a really well written article.
    I’ll make sure to bookmark it and return to read more of your useful information. Thanks for the post. I’ll certainly comeback.

  4. Oh my goodness! Awesome article dude! Many thanks, However I am having difficulties
    with your RSS. I don’t know why I can’t join it.
    Is there anybody getting similar RSS problems? Anyone who knows the answer will you kindly respond?


  5. I’m curious to find out what blog platform you’re working with?
    I’m experiencing some small security problems with my
    latest site and I’d like to find something more secure.
    Do you have any solutions?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s