Hi,

In asp.net 1.1 i m using response.redirect("a.pdf") but if file is not
present then HTTP error 404 "Page not found" is displayed is there any
way I can control it using web.config or global.asa



I am aware it can be controlled using IIS -- virtual directory -
custom error tab but being complex application i cannot set IIS
virtual directory custom pages.

I am trying following code but it is not working:

* * * * aspx: * * * *
<form id="Form1" method="post" runat="server">
<asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 181px;
POSITION: absolute; TOP: 104px" runat="server"
Text="Button"></asp:Button>
</form>

* * * * vb code: * * * *
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Page.IsPostBack Then
Response.Redirect("a.pdf", False)
End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click

End Sub

* * * * web.config: * * * *
<customErrors mode="RemoteOnly" defaultRedirect="PageNotFound.aspx" />

Request to let me know why HTTP 404 error code is not trapped in above
code.

Regards,
Amit