Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - IIS HTTP Error Code: 404

Reply
 
Old 12-08-2008   #1 (permalink)
a.bavdhankar


 
 

IIS HTTP Error Code: 404

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

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Free Source Code + Interview Question(http://www.sourcecode4you.com/) .NET General
Errors- HTTP, Terminal Services, TBS, DPS, UAC, Code Integrity, WM Vista General
Error Code 80048820; extended error code 80048439 Live Messenger
Certain emails not displaying http code properly Vista mail
have any example code for reading HTTP status codes and headers? PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46