Sul server non riesco a visualizzare gli errori dettagliati in ASP anche omettendo oppure mettendo il flag su "Mostra messaggi errore http brevi".
L'errore che mi viene restituito è o una pagina bianca oppure il classico
"500 - Internal Server Error"
Per ovviare al problema ho provato a gestire io gli errori ma la situazione non cambia mi da sempre: 500 Internale Server Error.
Questo è lo script:
In rosso ho evidenziato la mancata chiusura per far andare in errore la pagina e testare la gestione degli errori.codice:<% On Error Resume Next ' *** Validate request to log in to this site. MM_LoginAction = Request.ServerVariables("URL") If Request.QueryString <> "" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString) MM_valUsername = CStr(Request.Form("username")) If MM_valUsername <> "" Then Dim MM_fldUserAuthorization Dim MM_redirectLoginSuccess Dim MM_redirectLoginFailed Dim MM_loginSQL Dim MM_rsUser Dim MM_rsUser_cmd MM_fldUserAuthorization = "" MM_redirectLoginSuccess = "hp_gestionale.asp" MM_redirectLoginFailed = "erroreLogin.asp" MM_loginSQL = "SELECT username, password" If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization MM_loginSQL = MM_loginSQL & " FROM login WHERE username = ? AND password = ?" Set MM_rsUser_cmd = Server.CreateObject ("ADODB.Command") MM_rsUser_cmd.ActiveConnection = MM_scadenzarioDomini_STRING MM_rsUser_cmd.CommandText = MM_loginSQL MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 255, MM_valUsername) ' adVarChar MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 255, Request.Form("password")) ' adVarChar MM_rsUser_cmd.Prepared = true Set MM_rsUser = MM_rsUser_cmd.Execute If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then ' username and password match - this is a valid user Session("MM_Username") = MM_valUsername If (MM_fldUserAuthorization <> "") Then Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value) Else Session("MM_UserAuthorization") = "" End If if CStr(Request.QueryString("accessdenied")) <> "" And false Then MM_redirectLoginSuccess = Request.QueryString("accessdenied") End If MM_rsUser.Close Response.Redirect(MM_redirectLoginSuccess) End If MM_rsUser.Close Response.Redirect(MM_redirectLoginFailed) 'End If If Err.Number > 0 Then Response.Write "E' avvenuto un errore!!!" & " " Response.Write "Descrizione: " & Err.Description & " " Response.Write "Numero: " & Err.Number & " " Response.Write "Origine: " & Err.Source End If %>
In verde ho messo l'istruzione per la gestione dell'errore.
Mi viene il dubbio che quando ricevo l'errore 500 Internal Server Error la gestione degli errori non funziona.
Potete darmi qualche suggerimento.
![]()
Grazie e tutti in anticipo.

 
					
					
					
						
  Rispondi quotando