Question

There is an ASP.NET 4.0 website and this is for mobile phones. Since, still many mobiles do not have Javascript support I used Native FROM. I've prepared a test page and here it is:

In test.aspx file

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>

<!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" action="test2.aspx" method="POST">
    <div>
        <input type="checkbox"  name="ckeck1"/>
        <input type="text" value="test" id="btnText" name="btnText"/>
        <input type="submit" value="Click"/>
    </div>
    </form>
</body>
</html>

In test.aspx.cs file there is nothing. In the post page Test2.aspx.cs

protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.UrlReferrer == null || !Request.UrlReferrer.AbsoluteUri.Contains("test.aspx"))
            Response.Redirect("test.aspx?p=" + Request.QueryString["packagecode"] + "&requestId=" + Request.QueryString["requestId"]);

        if (Request.Form["ckeck1"] != null)
            Response.Write(Request.Form["ckeck1"].ToString() + "<br>");
        if (Request.Form["btnText"] != null)
            Response.Write(Request.Form["btnText"].ToString() + "<br>");
        if (Request.UrlReferrer != null)
            Response.Write("Url: " + Request.UrlReferrer.AbsoluteUri + "<br>");
    }

The code is working just fine with almost all mobile browsers..

But, in OPERA MINI and OPERA MOBILE, this code does NOT POST instead it just refreshes the page.

Can anyone tell me why this is happening and how to solve it?

Était-ce utile?

La solution

I figured it out. And here are the things we must have paid attention: 1) No GET, only POST

<form id="form1" action="test2.aspx" method="POST">

2) Opera browsers CANNOT read CSS 3.0 - And because of that, it displays the page but CANNOT POST at all...

I used to like Opera back in 2003 or 2004, and I guess I found one more reason not to like it.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top