A
Alan Silver
Hello,
I have a page where I use URL rewriting, so the user sees something
like...
http://www.domain.com/item_12.aspx
but the real URL is...
http://www.domain.com/product.aspx?productid=12
I would like to be able to postback to that page, but doing so would
post back to the underlying URL, ie product.aspx and not to the fake
URL.
I tried using a class inherited from the Form class that removed the
action attribute, causing the page to post back to itself (found this
somewhere in MSDN ages ago), which worked fine, but I have just
discovered that this stops validation working, so I don't want to use
it.
I tried getting around this by allowing it to post to product.aspx, then
in Page_Load, getting the querystring variable, building the fake URL
and then redirecting to that. Trouble is, when I try this, I get the
following exception...
"Invalid postback or callback argument. Event validation is enabled
using <pages enableEventValidation="true"/> in configuration or <%@ Page
EnableEventValidation="true" %> in a page. For security purposes, this
feature verifies that arguments to postback or callback events originate
from the server control that originally rendered them. If the data is
valid and expected, use the
ClientScriptManager.RegisterForEventValidation method in order to
register the postback or callback data for validation."
I haven't a clue what this means!!
Anyone able to help? I'm using 2.0 if it helps. TIA
I have a page where I use URL rewriting, so the user sees something
like...
http://www.domain.com/item_12.aspx
but the real URL is...
http://www.domain.com/product.aspx?productid=12
I would like to be able to postback to that page, but doing so would
post back to the underlying URL, ie product.aspx and not to the fake
URL.
I tried using a class inherited from the Form class that removed the
action attribute, causing the page to post back to itself (found this
somewhere in MSDN ages ago), which worked fine, but I have just
discovered that this stops validation working, so I don't want to use
it.
I tried getting around this by allowing it to post to product.aspx, then
in Page_Load, getting the querystring variable, building the fake URL
and then redirecting to that. Trouble is, when I try this, I get the
following exception...
"Invalid postback or callback argument. Event validation is enabled
using <pages enableEventValidation="true"/> in configuration or <%@ Page
EnableEventValidation="true" %> in a page. For security purposes, this
feature verifies that arguments to postback or callback events originate
from the server control that originally rendered them. If the data is
valid and expected, use the
ClientScriptManager.RegisterForEventValidation method in order to
register the postback or callback data for validation."
I haven't a clue what this means!!
Anyone able to help? I'm using 2.0 if it helps. TIA