PDA

View Full Version : .NET 2.0 ASPX pages won't display on .mobi emulator



ezinaz
07-10-2007, 01:14 AM
Hi guys. I'm having a heck of a time understanding why my .NET pages won't display on the Emulator when I switch the .NET version to 2.0 on the web server. When I run the site on .NET 1.1 (using the same code, just switch the ASP.NET version to 1.1) the site displays on the emulator.

I currently have the site set at ASP.NET 2.0.

Take a look at the site on the emulator:
http://emulator.mtld.mobi/emulator.php?webaddress=mobicity.mobi&emulator=sonyK750&Submit=Submit

I get the error: The requested item could not be loaded. (Status code 502)

Now check out the site in the browser (displays fine):
http://mobicity.mobi

I've checked the response headers using a plug-in to Firefox, and the headers are exactly the same whether I'm in 1.1 or 2.0 mode. Also, the resulting html appears to be exactly the same and appears to be xhtml compliant:


<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Mobicity.mobi</title>
<link href="style.css" type="text/css" rel="stylesheet" />
<meta content="" />
</head>
<body>
Mobicity.mobi<br/>
<div>Enter a City</div>
<form name="citysearch" action="citysearch.aspx" method="get">
<input type="textbox" name="city" />
<input type="submit" value="Find" />
</form>
<div>Select a Popular City</div>
<div><a href="city.aspx?destid=D5775B77-0B35-468E-830D-0675F8FAB328">Anaheim</a></div>
<div><a href="city.aspx?destid=0A76BCAC-47C9-49D9-8F2D-B164A6E568D4">Chicago</a></div>
<div><a href="city.aspx?destid=344D3C26-BBBF-4A6A-8B5C-4979A97F809A">Denver</a></div>
<div><a href="city.aspx?destid=4FDED4FF-AF4A-41B7-976B-BD5BD436F135">Las Vegas</a></div>
<div><a href="city.aspx?destid=B092733B-991A-47B1-8F10-46EA10FA8E00">Los Angeles</a></div>
<div><a href="city.aspx?destid=AF53DBE5-B7DF-4960-9DE3-D373DBB1DA36">Miami</a></div>
<div><a href="city.aspx?destid=572B0850-4E3F-469B-87B2-C17ED3EA049B">New York</a></div>
<div><a href="city.aspx?destid=4FF23C22-E4FF-4834-91BD-08BAD605FE8C">Orlando</a></div>
<div><a href="city.aspx?destid=EFBE2A3B-3D6B-4625-9DC1-7DA0B396EF87">Phoenix</a></div>
<div><a href="city.aspx?destid=9C816970-833E-4953-9BC2-9769E5C7D1AD">San Diego</a></div>
<div><a href="city.aspx?destid=8D4456FB-4038-4A55-BCBE-AA544AB549AD">San Francisco</a></div>
<div><a href="city.aspx?destid=978B18CC-DB28-469F-9C7D-93777C712AFA">Seattle</a></div>
<br/><a href="index.aspx">[0] Home</a>
</body>
</html>

Does anyone have any ideas as to what the problem may be here?

Thanks...EZINAZ

ezinaz
07-10-2007, 08:10 AM
I found the solution for this. Ready.mobi was reporting the following:



The MIME types sent by servers give very important information to browsers as to how to treat a document. If incorrect MIME types are sent with a document, it may prevent the browser from correctly interpreting the document and failing to render a document.
For XHTML-MP, the recommended MIME type is application/vnd.wap.xhtml+xml or application/xhtml+xml. Unlike HTML, XHTML-MP should not be served as text/html.
Web servers are often set up correctly for common document types such as HTML and CSS, but often do not have the correct doc types for XHTML-MP. Please refer to dev.mobi (http://dev.mobi/) for instructions on how to set up your MIME types correctly.


FAIL
MIME type for main doc: text/vnd.wap.wml; charset=utf-8


I just changed the MIME type for the page to text/html (even though it says not to in the warning above, and the page now displays correctly in the emulator. I can experiment with other MIME types later.
This was performed by adding the ContentType attribute to the page directive, like so:


<%@ Page Language="VB" ContentType="text/html" %>

GijsZePa
07-11-2007, 02:58 PM
Hi Ezinaz...

Nice to see a fellow asp.net programmer in the .mobi world. I thought I was the only one *grin*

Keep up the good work...

Martin

LaMondeA
11-20-2007, 05:21 PM
I'm finding problems with the emulators as well.

I have a .NET page that I know for a fact has a div around the viewstate, but when the emulators process it, it says it's not there.

GijsZePa
11-20-2007, 08:22 PM
I'm finding problems with the emulators as well.

I have a .NET page that I know for a fact has a div around the viewstate, but when the emulators process it, it says it's not there.

Well..my aspx pages work perfect in the emulators:
check my latest project http://www.wepseit.com/app1

Martin