I'm having the same problem as mentioned here (but that question is
closed without a solution):
http://groups.google.com/group/UrlRewritingNet/browse_frm/thread/c89577b60c28f0f0
---
Say I have 2 files, both use an alias, e.g.:
File: Alias:
Pages/1.aspx abc.aspx
Pages/2.aspx def.aspx
Then this would be my rewrites section in the Web.Config:
<rewrites>
<add virtualUrl="^~/abc.aspx"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="~/Pages/1.aspx"
ignoreCase="false"/>
<add virtualUrl="^~/def.aspx"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="~/Pages/2.aspx"
ignoreCase="false"/>
</rewrites>
My Pages/1.aspx has two form elements:
<asp:textbox runat="server" id="TextBox1"></asp:textbox>
<asp:button runat="server" text="Button" PostBackUrl="~/def.aspx"
/>
In my Pages/2.aspx (which is the Pages/1.aspx PostBackUrl) I try to
access TextBox1 through the PreviousPage property, but PreviousPage
seems to be null and
I get the following error:
'PreviousPage' threw an exception of type 'System.Web.HttpException'
and
{"The file '/abc.aspx' does not exist."}
Have you found a solution to this (btw: I'm fearly new to ASP.NET,
maybe I'm missing someting here)?
Thanks,
Arjen
i didn't try it by myself, but I guess that this could be a real "bug"
in the software, because we didn't use this feature till now. At least
for me Cross Page Posting wasn't on the agenda.
I'll add an entry on the bugtracker, maybe there will be a solution out
there within the next few weeks, but I can't ensure that.
Regards, Thomas
Thanks for the reply.
I've been trying to figure this out myself today and found a possible
solution:
Shouldn't the filePath parameter in the RewritePath function inside the
OnPagePreInit event be used to revert the filePath back to the path of
the physical file (destinationUrl)?
At this moment (one of) the RewritePath function calls looks like this:
context.RewritePath(virtualUrl, string.Empty, clientQueryString, true);
I replaced the virtualUrl with the physical Url (destinationUrl) and
this seems to work fine. The PreviousPage property now works. I guess
the PreviousPage property uses the filePath, set in the previous page
by RewritePath, to point to the physical file.
Until this point I didn't have any trouble with this solution but I
guess there is a reason you used the virtualUrl for the RewritePath.
My question is: does the replacing of the filePath parameter conflict
in any way with the module.
Thanks,
Arjen
Regards
http://weblogs.asp.net/jezell/archive/2004/03/15/90045.aspx
Sounds good, but i haven't tested it yet.