Hey Guys-

do you have any idea how to redirect on another page after Response.End() ? I want once file download compelte it will redirect user on another page.

I have tried a lot but didn't get any success. If you have any idea to achieve this then please let me know.

Thanks in advance !
Rohan

not possible even i tried.
i think u need to add a button which will perform redirection.

not possible even i tried.
i think u need to add a button which will perform redirection.

Thanks for your answer...But no i can't use the extra button, it';s the requirement that once file get download by user, he/she will redirect to another page.

Thanks for your answer...But no i can't use the extra button, it';s the requirement that once file get download by user, he/she will redirect to another page.

Try some other way of downloading. Because Response.End(0 will stop the page script.

you can try making a use of javascript to hit the pop up which will call the download and next you can redirect user..

try this..

// Code Behind

 protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/Default2.aspx");
    }
// Aspx Page..
<head runat="server">

    <script type="text/javascript" language="javascript">
        function myfunction() {
            window.open('default3.aspx', 'download Page')
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:DropDownList ID="DropDownList1" runat="server" Height="16px">
        </asp:DropDownList>
        <asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="myfunction();" OnClick="LinkButton1_Click">LinkButton</asp:LinkButton>
    </div>
    </form>
</body>

i've checked this it works like a charm...!
hope that helps

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.