ASPX isn't generating WML output

Discussion in 'ASP .Net Mobile' started by Jaime Stuardo, Sep 15, 2005.

  1. 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, Sep 15, 2005
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:...
    >> 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, Sep 24, 2005
    #2
    1. Advertising

  3. 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.w3schools.com 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" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:...
    >> 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, Sep 24, 2005
    #3
  4. 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" <> wrote in message
    news:OvjgI%...
    > 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" <> wrote in message
    > news:...
    > > 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" <> wrote in message
    > > news:...
    > >> 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, Sep 26, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John M
    Replies:
    1
    Views:
    1,243
    Kumar Reddi
    May 29, 2005
  2. =?Utf-8?B?Q2hyaXMgRGF2b2xp?=

    SMTP isn't working from aspx page

    =?Utf-8?B?Q2hyaXMgRGF2b2xp?=, Oct 16, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    554
    Kevin Spencer
    Oct 16, 2005
  3. Nathan Sokalski
    Replies:
    7
    Views:
    609
    Nathan Sokalski
    May 15, 2007
  4. ujjc001

    MMIT created aspx not producing wml

    ujjc001, Jan 28, 2005, in forum: ASP .Net Mobile
    Replies:
    2
    Views:
    141
    ujjc001
    Jan 31, 2005
  5. Nathan Sokalski

    Visual Studio isn't generating the Code Gen file (*.designer.vb)

    Nathan Sokalski, May 12, 2007, in forum: ASP .Net Web Controls
    Replies:
    7
    Views:
    165
    Nathan Sokalski
    May 15, 2007
Loading...

Share This Page