Thursday, April 12, 2007

Destroying ASP.Net with an IFRAME

Today, while implementing a "Thank you after download" page using the iFrame method, my page suddenly began throwing ArgumentExeption: Invalid postback or callback argument. I could not, for the life of me, figure out what was causing it.

I wasn't doing anything funny with any server-side controls and the page had been working just fine before I added the download code.

I turns out that I was using some HTML like this:

<iframe src="http://website.com/download" style="display: none;" />


Which is perfectly acceptable XHTML (as far I've bothered to find out). But ASP.Net has a conniption. You have to format it like this:

<iframe src="http://website.com/download" style="display: none;"></iframe>


So there you have it. If you don't use a closing tag on an iFrame in ASP.Net 2.0 it will throw a fit and you'll spend hours wondering what is going on.

No comments:

Post a Comment