Aleks
asked on
Append parameter to redirect
I am trying to redirect to another page after inserting a value
But I am getting a syntax error. What would the correct syntax be ?
Using classic ASP.
' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "parties_SPaddlinks.asp?NewUserId=<%=(rs_contact.Fields.Item('UserId').Value)%>"
But I am getting a syntax error. What would the correct syntax be ?
Using classic ASP.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you're essentially concatenating a string, so your format should be:
varName = "some text" & aVariable & "some more text" & anotherVariable
you're missing a beginning quote on your second example, it should be:
MM_editRedirectUrl = "parties_SPaddlinks.asp?Ne wUserId=" & (rs_contact.Fields.Item("U serId").Va lue) & "relation =" & Request("relation")
varName = "some text" & aVariable & "some more text" & anotherVariable
you're missing a beginning quote on your second example, it should be:
MM_editRedirectUrl = "parties_SPaddlinks.asp?Ne
ASKER
MM_editRedirectUrl = "parties_SPaddlinks.asp?Ne
I tried to add another parameter but my syntax did not work:
Open in new window
Sorry I should have asked with two parameters so I could add more later on if needed.