locked
HttpResponse.Output for WML browsers? RRS feed

  • Question

  • User667432888 posted
    Hi, In my program, I used HttpResponse.Output to write a response message rendered by the client browser. It works fine on emulators such as Pocket IE, Openwave 6.2.2, but not on Openwave 4.1.1. Then I modified the code that the message is no longer sent to the output stream, but to a dynamic label introduced to the form when the client device doesn't support HTML32. It's as the following: - Original code string s = "Sorry, the document is empty."; Response.Output.Write(s); - New code if (MobileCapabilities.PreferredRenderingTypeHtml32 != "html32") { Response.Output.Write(s); } else { System.Web.UI.MobileControls.Label lbl = new Web.UI.MobileControls.Label(); Panel1.Controls.Add(lbl); // a panel in the form s = "Sorry, the document is empty."; lbl.Text = s; lbl.ForeColor = Color.Red; } Although this can by pass this specific problem, I am still wondering why the gateway for the Openwave 4.1.1 emulator doesn't translate the message into WML as it does to a static aspx page. Anyone who would like to help me in here? A better solution is desired. Thanks. bonnie
    Monday, September 27, 2004 8:39 AM

All replies

  • User667432888 posted
    Sorry, the if condition should be : (HttpContext.Current.Request.Browser["preferredRenderingType"] == "html32")
    Monday, September 27, 2004 9:54 AM