×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Dec 2006
    Posts
    12

    Exclamation file format unknown (problem in redirection)

    Hi,
    I use the following code for my project, it seems, when i use "ASP:BUTTON" for checking (validity) and also redirection to another page. Seems, it cant pass passing values to another page it shows the message "file format unknown". After clicking the button it shows a warning message "Data you are sending will be redirected to another server Continue?", If i click yes, then it shows "file format unknown"! Btw i'm using Nokia 6020 and this code is working fine with all the OpenWave browsers (e.g. Siemens mobile phones).
    Thanks.



    >>page1.aspx<<

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Page1.aspx.cs" Inherits="Page1" ContentType="text/html" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <title>Untitled Page</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /></div>
    </form>
    </body>
    </html>

    >>page1.aspx.cs<<

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;

    public partial class Page1 : System.Web.UI.Page
    {
    protected void Page_Load(object sender, EventArgs e)
    {
    Response.ContentType = "text/html";
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
    Response.ContentType = "text/html";
    // Response.Write("It works");
    Response.Redirect("Page2.aspx?name=" + TextBox1.Text); // Don't Redirect
    }
    }





    >>page2.aspx<<

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Page2.aspx.cs" Inherits="Page2" ContentType="text/html" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <title>Untitled Page</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    <%= Name %>
    </div>
    </form>
    </body>
    </html>

    >>page2.aspx.cs<<

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;

    public partial class Page2 : System.Web.UI.Page
    {
    private String name = String.Empty;
    protected void Page_Load(object sender, EventArgs e)
    {
    Response.ContentType = "text/html";
    }
    public String Name
    {
    get { return name; }
    set { value = name; }
    }
    }
    Last edited by saikat_00; 2006-12-12 at 09:44.

  2. #2
    Registered User
    Join Date
    Jun 2006
    Location
    England
    Posts
    49

    Re: file format unknown (problem in redirection)

    What does the generated source code look like when it reaches a browser?

    May be able to help if i can see what is actually being delivered to the handset.

    have you tried sending the Xhtml Mobile mime type - 'application/vnd.wap.xhtml+xml' or 'application/xhtml+xml' instead of 'text/html'?

    And try the Xhtml Mobile Doctype -
    <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
    or
    The Xhtml 1.1 Doctype
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    instead of the Transitional one.
    Last edited by SimonThomas; 2006-12-13 at 02:34.
    http://wapple.net
    Mobile Internet Solutions

  3. #3
    Registered User
    Join Date
    Dec 2006
    Posts
    12

    Unhappy Re: file format unknown (problem in redirection)

    Quote Originally Posted by SimonThomas
    What does the generated source code look like when it reaches a browser?

    May be able to help if i can see what is actually being delivered to the handset.

    have you tried sending the Xhtml Mobile mime type - 'application/vnd.wap.xhtml+xml' or 'application/xhtml+xml' instead of 'text/html'?

    And try the Xhtml Mobile Doctype -
    <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
    or
    The Xhtml 1.1 Doctype
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    instead of the Transitional one.
    Thanks Buddy... But Its not working! I tried with possible combination and permutation!..
    Still don't know why this problems shows!

  4. #4
    Registered User
    Join Date
    Jun 2006
    Location
    England
    Posts
    49

    Re: file format unknown (problem in redirection)

    And is your server setup to deliver those Mimetypes??

    Is there an xml declaration? i dont see one,and your declaring Xhtml Doctype.


    <?xml version="1.0" encoding="utf-8"?>
    <!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">
    ..........
    </html>
    http://wapple.net
    Mobile Internet Solutions

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    22

    Re: file format unknown (problem in redirection)

    Some mobile browsers require a fullpath when redirecting, e.g. http://www... etc, instead of just a pagename.

    Another problem might be that some browsers can not handle a redirect immediatly following a POST action. I've seen this error several times. Change the method to GET and it will work. Or if you don't write any contents to the browser in your 'validation' page, you might want to use server side redirect (server.transfer on IIS). This uses relative paths (instead of virtual paths) and is browser independant.

Similar Threads

  1. ERROR RCmake.exe AND rcomp.exe
    By jifik in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2005-10-31, 12:24
  2. Errors compilling and debugging Helloworld
    By doberlet in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2004-03-04, 18:08
  3. Codewarrior import .mmp error
    By serenade in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2004-02-21, 20:06
  4. File format unknown error on 3410
    By vijjay in forum Mobile Java General
    Replies: 0
    Last Post: 2002-11-17, 11:20

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •