开发者

Page not found error in ASP.NET

开发者 https://www.devze.com 2023-02-14 19:45 出处:网络
Protected Sub ImageButton3_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton3.Click
  Protected Sub ImageButton3_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton3.Click
        If ImageButton3.ImageUrl = ("./images/back.png") Then
            Me.Response.Redirect("http://www.volvobusesindia.com")
        Else
            Try
                Dim SmtpServer As New SmtpClient()
                Dim mail As New MailMessage()
                SmtpServer.Credentials = New Net.NetworkCredential("info@volvobusesindia.com", "xxxxxx")
                SmtpServer.Port = 25
                SmtpServer.Host = "mail.volvobusesindia.com"
                mail = New MailMessage()
                mail.From = New MailAddress("info@volvobusesindia.com")
                mail.To.Add(Literal23.Text)
                mail.Subject = "VolvoBusesIndia:E-Ticket Confirmation"
                mail.Body = "<B>" + "||| -- VOLVOBUSESINDIA : E-Ticket Confirmation  -- |||" + "</B>" + "<BR><BR><BR>" + "<B>" + "PNR Number : " + "</B>" & " " & Literal2.Text + "<BR><BR>" + "<B>" + "Payment Reference Number : " + "</B>" & " " & Literal1.Text + "<BR><BR>" + "<B>" + "Ticket Number : " + "</B>" & " " & Literal3.Text + "<BR><BR>" + "<B>" + "Travels : " + "</B>" & " " & Literal4.Text + "<BR><BR>" + "<B>" + "From : " + "</B>" & " " & Literal7.Text + "<BR><BR>" + "<B>" + "To : " + "</B>" & " " & Literal8.Text + "<BR><BR>" + "<B>" + "Journey Date : " + "</B>" & " " & Literal10.Text + "<BR><BR>" + "<B>" + "Departure : " + "</B>" & " " & Literal11.Text + "<BR><BR>" + "<B>" + "Arrival : " + "</B>" & " " & Literal12.Text + "<BR><BR>" + "<B>" + "Boarding Point : " + "</B>" & " " & Literal13.Text + "<BR><BR>" + "<B>" + "Dropping Point : " + "</B>" & " " & Literal14.Text + "<BR><BR>" + "<B>" + "Seat Selected : " + "</B>" & " " & Literal15.Text + "<BR><BR>" + "<B>" + "Seat Opted : " + "</B>" & " " & Literal16.Text + "<BR><BR>" + "<B>" + "Bus Type : " + "</B>" & " " & Literal17.Text + "<BR><BR>" + "<B>" + "Total Amount : " + "</B>" & " " & Literal19.Text + "<BR><BR>" + "<B>" + "Payment Status : " + "</B>" & " " & Label1.Text + "<BR><BR>" + "<B>" + "Paid via : " + "</B>" & " " & Literal20.Text + "<BR><BR>" + "<B>" + "Message : " + "</B>" & " " + "<BR>" & "Volvo Buses India Wishes you a very Happy Journey, hope you satisfied with our services"
                mail.IsBodyHtml = True
                SmtpServer.Send(mail)
            Catch ex As Exception
   开发者_开发百科             MsgBox(ex.ToString)
            End Try
            Try
                Using conn = New SqlConnection(constr)
                    Using cmd = conn.CreateCommand()
                        conn.Open()
                        Dim sql As String = "UPDATE a1_ticket SET BANK = @bank, PAID = @paid, BID = @bid WHERE Ticket_no = @ticketNo"
                        cmd.CommandText = sql
                        cmd.Parameters.AddWithValue("@bank", Literal20.Text)
                        cmd.Parameters.AddWithValue("@paid", Label1.Text)
                        cmd.Parameters.AddWithValue("@bid", Literal21.Text)
                        cmd.Parameters.AddWithValue("@ticketNo", Literal3.Text)
                        cmd.ExecuteNonQuery()
                    End Using
                End Using
            Catch ex As Exception
                Response.Write(ex.Message)
            End Try
            Response.Redirect("~/eticket.aspx?Pno=" & Literal2.Text & "&tid=" & Literal22.Text & "&Status=" & "Print_ticket_success")
        End If
    End Sub

Page not found error occurs ....but the pages are alredy uploaded ...

eticket.aspx and website http://www.volvobusesindia.com


Check what controls the page is using, part of the error is:

(or one of its dependencies)

This means that if for example you're using MyControl.ascx and such file doesn't exist, you'll get the same 404 error.


Check if the page

 eticket.aspx

exists in the root folder of your application. A quick check online shows that eticket.aspx doesn't exist in the root of www.volvobusesindia.com.

Maybe your application is in a subfolder?


http://www.volvobusesindia.com/eticket.aspx gives me 404 page not found exception. Can you check again for the existence of this page?


Few points:

  1. Is your current context is clixngo.com or volvobusesindia. If its volvo buses india, then we are encounter 404.

  2. Response.Redirect(~/..) will only work on current domain. for other domain you have to specify the whole string.

0

精彩评论

暂无评论...
验证码 换一张
取 消