English 中文(简体)
My mobile site does not render on certain mobile phones. Why?
原标题:

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?

问题回答

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

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.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签