0

I am developing a basic mobile site in asp.NET and C# and am having problems rendering .aspx pages on certain mobile phone browsers.

I tried Stackoverflow.Mobi on a nokia looking for good examples for coding mobile sites. As soon as I redirect to another page I receive the error "File Format Unknown."

As soon as i use the button_click event to transfer to another page the "File Format Unknown." shows up on the mobile divice.

I have tried the following as suggested fixes from numerous forums but without any luck.

  1. Setting Page contentype : ContentType="text/html"
  2. Server.Transfer
  3. Response.ContentType = "application/xhtml+xml";
    Response.Redirect("Test.aspx");
  4. Posting to the Full URL www.XXXX.com/test.aspx

One of the phones i am having problems with is a Nokia 6300

Any suggestions?

  • 1
    shouldn't this be moved to http://meta.stackoverflow.com? – Abel Dec 03 '09 at 13:39
  • ps. stackoverflow.mobi is not developed by stackoverflow team. Perhaps you could list on which mobile browsers you've tried? And post a capture log of the headers send out to the device? – Davy Landman Dec 03 '09 at 13:40
  • 1
    The OP is not clear about which particular aspx pages are causing the issue. However, it sounds like the third party site stackoverflow.mobi renders fine. Most links there are to stackoverflow.com (SO). If the OP's problem is with SO, then the post belongs on meta. – Ewan Todd Dec 03 '09 at 13:49

2 Answers2

0

Normaly this is a problem with doc-type, because asp.net changes it to wap/application. I will recommend you use Fiddler for checking http headers. Normaly,Page directive ContentType should solve it

<%@ Page Language="C#" ... ContentType="text/html" %>

But you have set :-S

fravelgue
  • 2,633
  • 2
  • 24
  • 23
  • Thanks for the answer by i have tried that. It seems to be certain nokia version that are buggy... Welcome to the world of mobile. – user223816 Dec 04 '09 at 09:56
  • Do you have used fiddler? I have this problem and asp.net was sending this Content-Type: text/vnd.wap.wml; charset=utf-8 in http headers – fravelgue Dec 04 '09 at 10:41
  • Sry, you have to change user agent to your problem phone. – fravelgue Dec 04 '09 at 10:41
  • Hi I have decided to go the MVC route and it seems to work much better on mobile devices. – user223816 Dec 04 '09 at 11:10
  • Yes, it will be better. But i´m developing a mobile portal using asp.net webforms with xhtml MP and i run ok in mobile device supports xhtml. – fravelgue Dec 04 '09 at 12:09
0

Make sure your html passes w3c validation. I know Blackberry device will have trouble displaying pages where the Html does not validate according to the doctype.

kelsmj
  • 1,183
  • 11
  • 18