[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.mobile

ASPX isn't generating WML output

Jaime Stuardo

9/15/2005 3:39:00 AM

Hi all..

I have developed an ASP.NET Mobile Web project using Visual Studio .NET
2003. The page is very simple (just displays a message).

I placed the page in a web server running Windows Server 2003.

When I connect to the page using Internet Explorer, it receives the correct
HTML page, but when I connect to it using my Cell Phone, I get the "Bad
Gateway" error. I think it is because IIS is sending HTML instead of WML.

I have used a cell phone emulator and I get this error:

"Wrong mime-type, I got text/html; charset=utf-8, but I want
text/vnd.wap.wml.
This error occurs when you request a page that is not a WAP page, or when
the webserver isn't set up correctly for hosting WAP sites "

That confirms me that IIS is sending HTML.

How can I solve it?

Thanks
Jaime


3 Answers

Jaime Stuardo

9/24/2005 5:43:00 PM

0

Hello Guyv..
I have done so, but I realized that Page_Init isn't being called.
This is the code I have:

public class download : System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.Form frm;

private void Page_Load(object sender, System.EventArgs e)
{
Response.Write("hello");
}

void Page_Init()
{
Response.ContentType = "text/vnd.wap.wml";
}
.....
}

I have placed breakpoints in Page_Load and in Page_Init and only Page_Load
get called.

Jaime


"news.microsoft.com" <guyv@guyv.com> wrote in message
news:Oiwru6ovFHA.3688@tk2msftngp13.phx.gbl...
> 1. You must assign WAP page ContentType to
> Web service level. ( see attached image )
>
>
> 2. Set the ContentType in design page(not .wml)
>
> void Page_Init()
> {
> Response.ContentType = "text/vnd.wap.wml";
> }
>
>
>
> - GuyV (guyv(at)guyv.com)
>
> "Jaime Stuardo" <jstuardo@manquehue.net> wrote in message
> news:uyNGfcauFHA.3452@TK2MSFTNGP14.phx.gbl...
>> Hi all..
>>
>> I have developed an ASP.NET Mobile Web project using Visual Studio .NET
>> 2003. The page is very simple (just displays a message).
>>
>> I placed the page in a web server running Windows Server 2003.
>>
>> When I connect to the page using Internet Explorer, it receives the
> correct
>> HTML page, but when I connect to it using my Cell Phone, I get the "Bad
>> Gateway" error. I think it is because IIS is sending HTML instead of WML.
>>
>> I have used a cell phone emulator and I get this error:
>>
>> "Wrong mime-type, I got text/html; charset=utf-8, but I want
>> text/vnd.wap.wml.
>> This error occurs when you request a page that is not a WAP page, or when
>> the webserver isn't set up correctly for hosting WAP sites "
>>
>> That confirms me that IIS is sending HTML.
>>
>> How can I solve it?
>>
>> Thanks
>> Jaime
>>
>>
>
>
>
>


Jaime Stuardo

9/24/2005 8:02:00 PM

0

Hi again..

I'm wondering why I should put Response.ContentType = "text/vnd.wap.wml";
since ASP.NET could generate the corresponding output depending on the
target device.

I have followed the tutorial in http://www.w3s... and there it was
created a simple WAP application that is supposed to be viewed as a WML card
in a cellphone and as HTML in a pocket PC.

Jaime

"news.microsoft.com" <guyv@guyv.com> wrote in message
news:Oiwru6ovFHA.3688@tk2msftngp13.phx.gbl...
> 1. You must assign WAP page ContentType to
> Web service level. ( see attached image )
>
>
> 2. Set the ContentType in design page(not .wml)
>
> void Page_Init()
> {
> Response.ContentType = "text/vnd.wap.wml";
> }
>
>
>
> - GuyV (guyv(at)guyv.com)
>
> "Jaime Stuardo" <jstuardo@manquehue.net> wrote in message
> news:uyNGfcauFHA.3452@TK2MSFTNGP14.phx.gbl...
>> Hi all..
>>
>> I have developed an ASP.NET Mobile Web project using Visual Studio .NET
>> 2003. The page is very simple (just displays a message).
>>
>> I placed the page in a web server running Windows Server 2003.
>>
>> When I connect to the page using Internet Explorer, it receives the
> correct
>> HTML page, but when I connect to it using my Cell Phone, I get the "Bad
>> Gateway" error. I think it is because IIS is sending HTML instead of WML.
>>
>> I have used a cell phone emulator and I get this error:
>>
>> "Wrong mime-type, I got text/html; charset=utf-8, but I want
>> text/vnd.wap.wml.
>> This error occurs when you request a page that is not a WAP page, or when
>> the webserver isn't set up correctly for hosting WAP sites "
>>
>> That confirms me that IIS is sending HTML.
>>
>> How can I solve it?
>>
>> Thanks
>> Jaime
>>
>>
>
>
>
>


news.microsoft.com

9/26/2005 8:51:00 AM

0

Hi Jaime,

I'm sorry. I didn't test WML pages access on Cellular phone with MS
MobileControl.
If MobilControl is "automatically" change the content type
text/html(default) to text/vnd.wam.wml,
Nothing to problem. But most phones WAP browser can't accept text/html
content.

And this is one of important thing.
The WML contents are must without caching. and well-formed document type.

Response.AddHeader ("Cache-Control", "no-cache");
Response.AddHeader ("Expires", "0");
Response.AddHeader ("Pragma", "no-cache");


this code is tested on WML 1.1 browser embedded celluar phone.


<%@ Page Language="C#" Runat="server" Debug=True %>

<script language="C#" runat="server">

void Page_Init()
{

..

Response.ContentType = ("text/vnd.wap.wml");
Response.AddHeader ("Cache-Control", "no-cache");
Response.AddHeader ("Expires", "0");
Response.AddHeader ("Pragma", "no-cache");

..

}

</script>

.......


<?xml version="1.0" encoding="UTF-8"?>
<wml>

<card id="init">

<p align="center">
test
</p>
</card>

</wml>




PS. your code is incurrect.

public class download : System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.Form frm;

private void Page_Load(object sender, System.EventArgs e)
{
/// Response.Write("hello");

Response.Write ("<wml><card id=\"init\"><p>Hello</p></card></wml>")
}

void Page_Init()
{
Response.ContentType = "text/vnd.wap.wml";
}
.....
}



Good luck

GuyV (guyv(at)guyv.com)


"Jaime Stuardo" <jstuardo@manquehue.net> wrote in message
news:OvjgI%23SwFHA.1132@TK2MSFTNGP10.phx.gbl...
> Hello Guyv..
> I have done so, but I realized that Page_Init isn't being called.
> This is the code I have:
>
> public class download : System.Web.UI.MobileControls.MobilePage
> {
> protected System.Web.UI.MobileControls.Form frm;
>
> private void Page_Load(object sender, System.EventArgs e)
> {
> Response.Write("hello");
> }
>
> void Page_Init()
> {
> Response.ContentType = "text/vnd.wap.wml";
> }
> ....
> }
>
> I have placed breakpoints in Page_Load and in Page_Init and only Page_Load
> get called.
>
> Jaime
>
>
> "news.microsoft.com" <guyv@guyv.com> wrote in message
> news:Oiwru6ovFHA.3688@tk2msftngp13.phx.gbl...
> > 1. You must assign WAP page ContentType to
> > Web service level. ( see attached image )
> >
> >
> > 2. Set the ContentType in design page(not .wml)
> >
> > void Page_Init()
> > {
> > Response.ContentType = "text/vnd.wap.wml";
> > }
> >
> >
> >
> > - GuyV (guyv(at)guyv.com)
> >
> > "Jaime Stuardo" <jstuardo@manquehue.net> wrote in message
> > news:uyNGfcauFHA.3452@TK2MSFTNGP14.phx.gbl...
> >> Hi all..
> >>
> >> I have developed an ASP.NET Mobile Web project using Visual Studio .NET
> >> 2003. The page is very simple (just displays a message).
> >>
> >> I placed the page in a web server running Windows Server 2003.
> >>
> >> When I connect to the page using Internet Explorer, it receives the
> > correct
> >> HTML page, but when I connect to it using my Cell Phone, I get the "Bad
> >> Gateway" error. I think it is because IIS is sending HTML instead of
WML.
> >>
> >> I have used a cell phone emulator and I get this error:
> >>
> >> "Wrong mime-type, I got text/html; charset=utf-8, but I want
> >> text/vnd.wap.wml.
> >> This error occurs when you request a page that is not a WAP page, or
when
> >> the webserver isn't set up correctly for hosting WAP sites "
> >>
> >> That confirms me that IIS is sending HTML.
> >>
> >> How can I solve it?
> >>
> >> Thanks
> >> Jaime
> >>
> >>
> >
> >
> >
> >
>
>