Can anyone help me with this problem:
I have a direct event and in it create txt file, which then I want to send to the client. The problem is that file opens directly in browser, but I need to directly download it.

Here is the code:
        protected void ButtonGetTxt_DirectClick(object sender, DirectEventArgs e)
                        Response.AddHeader("content-disposition", "attachment; filename=" + fileName);
                        Response.ContentType = "text/plain";
                                <ext:Button ID="ButtonGetTxt" runat="server" Text="Get txt" Disabled="true">
                                        <Click OnEvent="ButtonGetTxt_DirectClick" >
                                                <ext:Parameter Name="param1" Value="Ext.encode(getNZP())" Mode="Raw"></ext:Parameter>
                                            <EventMask ShowMask="true" Target="Page" Msg="<%$ Resources:Rsc, Loading %>" />

I try to put:

but it not work.

I used this logic for excel files and it works correctly, but for txt not.

Anyone knows how to do this?