server.transfer

  • Thread starter Thread starter Kondapanaidu
  • Start date Start date
K

Kondapanaidu

Server.transfer("path of html file")

I know that server.transfer wont process html pages.

What could be the reason?

Is there any way to run html pages in server.transfer


Regards
Naidu
 
Perhaps Response.Redirect is more what you are after?
I can't think of a specific reason why Server.Transfer wouldn't accept
a HTML page, but there might be a good reason under the hood of .NET
and IIS.

Also, you could hax it up a bit if you definately need a
server.transfer to instead pass it to an ASPX page that accepts a HTML
page as the argument (encoded of course) and then your target ASPX page
posts the content of the HTML file (open with a streamreader) to the
response stream. Thats a work around for you anyway.
 
Server.Transfer does not accept HTML pages as they are not served by .NET but
by IIS. Either rename the HTML page to ASPX or open it an send it down the
response stream.
I would also look at the implications of Server.Transfer compared to
Response.Redirect and check to see if you are using the right one.
Two obvious ones are Server.Transfer keeps the same server session open so
the response buffer may have already been written to, and the client is
unaware for the action so relative URLS and things like that can get messy.
Where as Repsonse.Redirect is a response and new request (with the network
usage involved in that) so the server has a clean slate to execute on and the
client is aware they are now looking at a different page.

The are good times and bad times to use both.

Ciaran O'Donnell
 
Server transfer passes execution of the current request to another asp.net
page. Given you cannot execute HTML (as its a presentation layer) there
would be no point in asking the runtime to execute it. Are you perhaps
looking to redirect to an HTML page and have the browser display that, if so
then issue a response.redirect would be what your seeking.

Regards

John Timney (MVP)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top