download after redirection to another page
I am working in ASP.net 2.0 and I have searched a lot for how to first redirect on download button click and then after redirection to the page开发者_开发百科 the downloading starts.
As using it works in mozilla but it is giving problem in IE.
I found that using Iframe I can resolve the issue. Or can anyone provide me the complete code for doing this.It will be highily appreciated.
Im gonna get a nasty downvote for this, but Here is some code to redirect a page to your IFrame
<iframe name="Pie" Width="500px" Height="500px" />
<a name="ClickMe" href="http://www.google.com" Target="Pie" >Click me!</a>
Substitute the href in the anchor tag to a local / webpage. If the page has an event to run a download (like in the Onload),It will trigger.
To redirect users to other pages as part of your Web application. ASP.NET provides the following ways for you to build redirection into your Web pages:
Using hyperlinks on pages.
Configuring cross-page posting, which enables you to specify an alternate target page when the current page is submitted.
Redirecting programmatically by forcing the browser to request a different page.
Redirecting programmatically by transferring control to a different page in the same Web application.
My personal favorate is
Response.Redirect("http://www.microsoft.com/gohere/look.htm");
You can find all the docuentation you need on msdn
On the button click you can redirect to any page, in that redirected page load you can write the code for downloading the file.
精彩评论