Skip to main content
Inspiring
February 10, 2009
Question

Insert record with a page anchor jump on redirect

  • February 10, 2009
  • 3 replies
  • 677 views
I'm doing a basic form insert record with a redirect to the same page. The only reason I have a redirect to the same page is the form is at the bottom of the page and I want to add an anchor and direct back down the page. I've been messing around with the DW code and haven't had any luck getting it to work. Does anyone have an idea how to redirect to the anchor? Here's the error: Application uses a value of the wrong type for the current operation.
Here's how I've been trying it:

Dim MM_editRedirectUrl
MM_editRedirectUrl = "edit.asp"
Dim MM_jump
MM_jump = "anchor=#jumpHere"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString & "#jumpHere"
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString & "#jumpHere"
End If
End If
Response.Redirect(MM_editRedirectUrl)
End If
This topic has been closed for replies.

3 replies

Inspiring
February 11, 2009
Mark.P. wrote:
> Thank you Dooza,
>
> That doesn't work, I tried it. It wants the anchor at the end of the url, after the id=00.
>
> Any other thoughts?

Hmmmmmm, not really...

Dim MM_editRedirectUrl
MM_editRedirectUrl = "edit.asp"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" &
Request.QueryString & "#jumpHere"
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" &
Request.QueryString & "#jumpHere"
End If
End If
Response.Redirect(MM_editRedirectUrl)
End If

That kinda looks ok to me as long as you have an anchor called jumpHere.

Dooza
--
Posting Guidelines
http://www.adobe.com/support/forums/guidelines.html
How To Ask Smart Questions
http://www.catb.org/esr/faqs/smart-questions.html
Mark_P_Author
Inspiring
February 11, 2009
Thank you Dooza,

That doesn't work, I tried it. It wants the anchor at the end of the url, after the id=00.

Any other thoughts?
Inspiring
February 11, 2009
Mark.P. wrote:
> I'm doing a basic form insert record with a redirect to the same page. The
> only reason I have a redirect to the same page is the form is at the bottom of
> the page and I want to add an anchor and direct back down the page. I've been
> messing around with the DW code and haven't had any luck getting it to work.
> Does anyone have an idea how to redirect to the anchor? Here's the error:
> Application uses a value of the wrong type for the current operation.
> Here's how I've been trying it:
>
> Dim MM_editRedirectUrl
> MM_editRedirectUrl = "edit.asp"
> Dim MM_jump
> MM_jump = "anchor=#jumpHere"
> If (Request.QueryString <> "") Then
> If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
> MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString &
> "#jumpHere"
> Else
> MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString &
> "#jumpHere"
> End If
> End If
> Response.Redirect(MM_editRedirectUrl)
> End If
>

If your page needs to redirect to edit.asp with an anchor named
jumphere, just use edit.asp#jumphere in the redirect field. You don't
need to change the code at all.

Dooza
--
Posting Guidelines
http://www.adobe.com/support/forums/guidelines.html
How To Ask Smart Questions
http://www.catb.org/esr/faqs/smart-questions.html