troubleshooting Question

Strictly Dreamweaver problem - redirect page after delete/insert/update

Avatar of jensjakobsen
jensjakobsenFlag for Denmark asked on
ASPAdobe Dreamweaver
8 Comments1 Solution690 ViewsLast Modified:

I want to redirect my users after an update/delete/insert to page where they already came from.

In short -  this is my scenario:

A: I insert data on page A. On the same page I display data created on page A as links.

B: Page B is a "detail page" (Dreamweaver lingo) based on the links from page A from where I can create more data (insert only) data as a subcategory to page A .

C: Page C is another "detail page" where I can update/delete subdata created on page B.

When I delete data on page C I want to be redirected back to page B where all the other relevant subdata to page A is shown.

Please take a look at the code provided and look for the text "createVoteType.asp" which is a redirect page I send my users to after they have updated/deleted data from page C.

I have tried a lot - like:
MM_editRedirectUrl = "createVoteType.asp?pkIntVoteID="+a variable I created dynamically from a session stored from earlier.

I hope any answers will be from experienced DW users but any help is of course very welcome.
' *** Delete Record: construct a sql delete statement and execute it

If (CStr(Request("MM_delete")) = "form1" And CStr(Request("MM_recordId")) <> "") Then

  If (Not MM_abortEdit) Then
    ' execute the delete
    Set MM_editCmd = Server.CreateObject ("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_connSQL_STRING
    MM_editCmd.CommandText = "DELETE FROM dragonswim_dk.tbl71VoteAnswerType WHERE pkIntAnswerTypeID = ?"
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 5, 1, -1, Request.Form("MM_recordId")) ' adDouble

    ' append the query string to the redirect URL
    Dim MM_editRedirectUrl
    MM_editRedirectUrl = "createVoteType.asp"
    If (Request.QueryString <> "") Then
      If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
        MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
        MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
      End If
    End If
  End If

End If
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros