Re: Server.TransferRequest()

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I see now...
You can not go outside of application scope with RewritePath.

you are going to face a problem with postback.
Try to add form and a button. Then click a button....

Check the URL in your address bar... You will see the problem.
the reason is that ASP.NET <form> grabs a current url and put it into action
property.
So your form tag will look like
<form action="http://domain/subapp/default.aspx";> which is probably not what
you want..

There are 2 solutions
1. Create your own class derived from HtmlForm and us it.
2. RewritePath back. Then form will have rewritten path in the action
property.
Althoug i am not sure you will be able to rewrite it to
http://domain/fakefolder/



George.



"Matt Winward" <m.winward@xxxxxxxxx> wrote in message
news:b94f73ee-0a54-422e-8209-c6a6bcb0533c@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi George.

I tried using RewritePath but ran into some problems. Basically, it
looked as though the application was still running from the root, so
all image and css paths were broken. Is there a way around this?

If I remember correctly, I think it also led to problems with the sub
application not being able to find its assemblies because it was still
working from the root and I ended up playing with assembly probing,
which didn't get very far.

After looking into this further, I've discovered it was something
silly .. I had a redirect in a handler in the sub application! I've
sorted that out and now I'm just left with some messed up image and
css paths, so I'm updating images etc to point to /SubApplication/,
which seems to be working.

So I've got the client URL as http://domain/fakefolder/ loading
http://domain/subapp/fakefolder/ and the subapp has a handler that
actually loads http://domain/subapp/default.aspx with some querystring
info.

Finally getting somewhere. Although this approach would mean upgrading
the servers to IIS7.

Can I ask why you prefer using RewritePath?


.


Quantcast