Discussion:
Open File with Response.Redirect
(too old to reply)
j***@unt.edu
2006-05-26 19:38:25 UTC
Permalink
I created a form and sent the inputs to an asp file where I use the
entry to open an excel file by saying

Response.Redirect("filename")

This all works fine, my question is...Does anyone know how to get a pop
up or something instead of going to This page cannot be found error
page? Not sure how I would code it to check for the file and then give
me a pop up if it isn't there.

Thanks
Mike Brind
2006-05-27 09:08:51 UTC
Permalink
Post by j***@unt.edu
I created a form and sent the inputs to an asp file where I use the
entry to open an excel file by saying
Response.Redirect("filename")
This all works fine, my question is...Does anyone know how to get a pop
up or something instead of going to This page cannot be found error
page? Not sure how I would code it to check for the file and then give
me a pop up if it isn't there.
Thanks
To check whether the Excel file exists, use the
Scripting.FileSystemObject http://www.aspfaq.com/show.asp?id=2039
before redirecting.

However, I would be tempted to use this to iterate throught the Excel
files and populate a <select> list with the names it finds, rather than
relying on users' own input. Then there won't be any page not found
errors.

In future, you would be better advised posting your asp questions to
microsoft.public.inetserver.asp.general. It's a lot busier over there,
and your question may be answered more quickly.

HTH

--
Mike Brind

Loading...