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("[email protected]", "xxxxxx")
SmtpServer.Port = 25
SmtpServer.Host = "mail.volvobusesindia.com"
mail = New MailMessage()
mail.From = New MailAddress("[email protected]")
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 introuvable erreur se produit .... mais les pages sont téléchargés alredy ...Page non trouvée erreur dans ASP.NET
eticket.aspx et site http://www.volvobusesindia.com
L'éclaboussure d'un morceau de code sans plus de contexte n'est pas un bon moyen de poser une question. Veuillez expliquer l'objectif du code, le résultat attendu et le résultat réel. – Oded
@ user594849 pourriez-vous nous donner plus d'informations?, C'est un problème de compilation?, Problème d'accès aux données?, Problème de visualisation des données?, Syntaxe SQL ?? – Morvader
On dirait qu'il obtient un 404 lorsque la page est utilisée. Il suffit de le déboguer petit à petit - effacez tous les blocs try pour la mise à jour SMTP et DB et voyez si cela fonctionne. Si ce n'est pas probablement l'une des références de chemin pour les redirections. Si cela fonctionne, laissez simplement le code revenir. Mon argent est redirigé vers "~/eticket.aspx" à la fin. –