Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to transfer execution to ASPX page from custom handler

Reply
Thread Tools

How to transfer execution to ASPX page from custom handler

 
 
Stanislav Ostachevski
Guest
Posts: n/a
 
      10-22-2003
Hello,

My app needs to map calls to "virtual files" to ASPX parametrized pages,
without showing user actual page address.
I.e, I want to catch calls to
http://myserver.com/products/id_prod...mefeature.ashx
and redirect them to
http://products.myserver.com/product...duct&features=....
but I don't want to reveal the actual URL of product.aspx
I catch all calls to ashx files by custom HTTP handler.
There's a problem: I can't use Server.Transfer call due to IIS redirection
issue (IIS can't redirect call to another DLL)
Microsoft suggests using Page.Redirect, but in this case new address will be
revealed, so I can't do so.

And I can't get reference to private PageHTTPHandler class.
Any advise would be greatly appreciated.



 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      10-22-2003
"Stanislav Ostachevski" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> Hello,
>
> My app needs to map calls to "virtual files" to ASPX parametrized pages,
> without showing user actual page address.
> I.e, I want to catch calls to
> http://myserver.com/products/id_prod...mefeature.ashx
> and redirect them to
> http://products.myserver.com/product...duct&features=....
> but I don't want to reveal the actual URL of product.aspx
> I catch all calls to ashx files by custom HTTP handler.
> There's a problem: I can't use Server.Transfer call due to IIS redirection
> issue (IIS can't redirect call to another DLL)
> Microsoft suggests using Page.Redirect, but in this case new address will

be
> revealed, so I can't do so.
>
> And I can't get reference to private PageHTTPHandler class.
> Any advise would be greatly appreciated.


This sort of thing should be done in an HttpModule, not an HttpHandler.
You're not actually "handling" the request. Instead you're modifying it and
then allowing the request to pass to the handler.

Your handler could check the request and do nothing if it's not a request
for a .ashx page. Otherwise, it could modify the URL with
HttpContext.RewritePath. The actual handler for .ashx pages should be the
same one that handles .aspx pages.

John


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Page lifecycle execution continues after server.transfer in 3.5 framework TS ASP .Net 7 03-17-2010 05:43 PM
Server.Transfer from custom HTTP handler? henke.lundin@gmail.com ASP .Net 1 08-28-2007 02:28 PM
Encrypt custom web.config section / cannot load custom handler? MichaelS ASP .Net Security 0 11-22-2006 04:11 PM
Server.Transfer and Context.Handler cause my popup to revert to the calling page? aaa ASP .Net 0 04-12-2005 10:06 PM
Re: Transfer from an ASP Page to an ASPX Page Ram ASP .Net 0 07-25-2003 06:52 AM



Advertisments