Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Closed Thread
Old 12-31-2009, 09:52 AM Redirect Url
itHighway's Avatar
Skilled Talker

Posts: 83
Name: Zeeshan Dar
Location: GUJ
Trades: 0
Hello,

I have a page that contain following script:


Quote:
<%
Response.ContentType = "application/x-unknown"
Response.AddHeader "content-disposition","attachment; filename=errors.htm"
%>
<table>
<tr>
<td>Error Description Text..</td>
</tr>
</table>
Many of you used this function would know that the above script opens a 'Save As' dialog box. I want browser to redirect to another page after user click 'Save' or 'Cancel' button on dialog box.


Any idea??
Any help??
__________________
Zeeshan Dar
itHighway -
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
itHighway is offline
View Public Profile
 
 
Register now for full access!
Old 12-31-2009, 10:03 AM Re: Redirect Url
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,336
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Because you are sending it as an unkown MIME Type. The code you have there is for a "force download"

To redirect in ASP the code is
response.redirect("path/filename.ext") which would generate a 302 response
or:
You can use the response.addheader as here
http://www.highrankings.com/forum/in...21&#entry60621
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
View Public Profile Visit chrishirst's homepage!
 
Old 01-02-2010, 06:12 AM Re: Redirect Url
Clarksy's Avatar
Junior Talker

Posts: 3
Trades: 0
You can't force a download and redirect at the same time - both or these actions terminate the current request.

If you want the user to redirect to another page then chrishirst is correct, use Response.Redirect. The redirect page could then use Javascript (backed up by a standard link) to begin downloading the file.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Clarksy is offline
View Public Profile Visit Clarksy's homepage!
 
Closed Thread     « Reply to Redirect Url
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.68807 seconds with 12 queries