Asked by:
Timer refresh page

Question
-
User1307252949 posted
Does anyone have any experience of Peter Bromberg's Acme timer refresh page?
I'm unable to display the page in WML, though it renders fine in XHTML.
Thursday, January 25, 2007 1:33 PM
All replies
-
User512894520 posted
I have used the Acme timer form control in my code and till now I haven't experienced any issues. I hope this is the same as the Refresh page that you are talking about. If so, then have you included all the proper Web.Config entries in the mobileControls section:
<device name="HtmlDeviceAdapters2" inheritsFrom="HtmlDeviceAdapters">
<control name="Acme.TimerFormCS,Acme.TimerFormCS" adapter="Acme.HtmlTimerFormAdapterCS,Acme.TimerFormCS"/>
</device>
<device name="ChtmlDeviceAdapters2" inheritsFrom="ChtmlDeviceAdapters">
<control name="Acme.TimerFormCS,Acme.TimerFormCS" adapter="Acme.ChtmlTimerFormAdapterCS,Acme.TimerFormCS"/>
</device>
<device name="UpWmlDeviceAdapters2" inheritsFrom="UpWmlDeviceAdapters">
<control name="Acme.TimerFormCS,Acme.TimerFormCS" adapter="Acme.WmlTimerFormAdapterCS,Acme.TimerFormCS"/>
</device>
<device name="WmlDeviceAdapters2" inheritsFrom="WmlDeviceAdapters">
<control name="Acme.TimerFormCS,Acme.TimerFormCS" adapter="Acme.WmlTimerFormAdapterCS,Acme.TimerFormCS"/>
</device>
If all these are in place as expected, then can you tell which device you are using to test the WML rendering of this page. Maybe I should test against this device as well to ascertain the issue.
Thanx.
Tuesday, January 30, 2007 12:48 AM -
User1307252949 posted
Hi Siddero,
I do already have that code in the <mobileControls> tag in my web.config file. Have you tried your code from a WAP emulator such as http://www.wapsilon.com/ ? Even the original Acme project that I've downloaded doesn't work on this emulator. The original page shows up but when you start the timer the next page shows up as "500 - Internal error", but this error only occurs if the page is being rendered as WML. [I haven't made any alterations to the original Acme project which would have knowingly, on my part, caused this error.]
I've added the WML MIME types to IIS but this doesn't help. Have you made any other modifications to your IIS or to the config file(s). On the source page the author mentions that "Creating a self-refreshing Form for ASP.NET Mobile is not as easy as it might seem at first blush; to do it right, you must include adapter code for HTML, cHTML and WML devices." Is this something he's already taken care of or is this a step I've probably omitted?
Thanks for any help you can offer.
Tuesday, January 30, 2007 1:59 PM -
User1307252949 posted
II've now re-copied the original TimerCS class as well as the default page from the source project (TimerForm) back into my own project and used the Default.aspx as is.
Now when I try to test from a WAP emulator I get an HTTP 302 error upon the first timer refresh. However, if I try to run the original source project from the same WAP emulator I get an HTTP 500 error upon the first refresh. I've no idea why the same page running under different projects causes different errors.
Incidentally, I've configured web.config to serve only WML pages.
Tuesday, January 30, 2007 4:46 PM -
User512894520 posted
I doubt if this will help but I'll just explain how it is that I am using this Acme TimerCS class. Instead of a refresh page mechanism I am using this as a redirector page. So there's just this one aspx page, say ReDirector.aspx, which uses this class. Inputs (via QueryString) to this ReDirector.aspx are the delay (defaults to 1 sec) and the Url to navigate to after the specified delay. I am using this page to transparently change protocols from http to https (and vice-versa) for pages which require secure connection. A simple Page.Response.Redirect was causing an informational response being sent to some WAP mobiles signalling that they are being redirected to some other page.
To achieve a Refresh, may be, you can send the same page as the RedirectUrl. Not sure if such a round-about solution would be acceptable. However, on testing with WAPSilon even my mechanism is throwing up some 'Incorrect XML Syntax' error. Apparently some issue with the Url I am using as the redirectUrl. Need some time to figure out this issue. If I stumble upon something else, I'll let you know.
Wednesday, January 31, 2007 1:44 AM