Two redirects on same page?
DW CS3 - ASP
Am going through an old (but excellent) training DVD for creating Insert/Update/Delete Record forms using DW & ASP.
Two forms are created on the same page - one to Update Record and one to Delete Record. Update works, but Delete creates an error:
Microsoft VBScript compilation error '800a0411'
Name redefined
/mysitename/myfolder/admin_edit.asp, line 95
Dim MM_editRedirectUrl
This error is apparently due to different redirect URLs for each form:
' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "admin_edit.asp"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
Response.Redirect(MM_editRedirectUrl)
End If
End If
%>
' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "admin_home.asp"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
Response.Redirect(MM_editRedirectUrl)
End If
End If
%>
I read that renaming the second Dim MM_editRedirectUrl to Dim MM_editRedirectUrl_2 will make things work correctly, and it DID! However, does this make for an unstable environment; and if so, what's the best approach to fixing this?
