Problem with HTML link with classic ASP

Asked

Viewed 193 times

1

The following piece of code is giving me trouble:

 While not rsQuery.EOF
            If vStrCurso <> rsQuery("SIGLA") Then
                ind = ind & "<p></p>"
                ind = ind & "<span><b><a href='"&vStrParametro7&"/Busca/"&rsQuery("ID_CURSO")&"/' target='blank'>"&rsQuery("SIGLA")&" - "&rsQuery("DESCR")&"</a></b></span><br/>"
                ind = ind & "<span>- <a href='"&vStrParametro7&"/Busca/"&rsQuery("ID_CURSO")&"/'&#calendario target='blank'>"&rsQuery("DT_INICIO")&" à "&rsQuery("DT_FIM")&"</a></span>"
            Else
                ind = ind & "<br/><span>- <a href='"&vStrParametro7&"/Busca/"&rsQuery("ID_CURSO")&"/'&#calendario target='blank'>"&rsQuery("DT_INICIO")&" à "&rsQuery("DT_FIM")&"</a></span><br/>"
            End If

Does not give an error message, just does not redirect. I believe there is something wrong with the bar and quotation marks, I have tried several times but without success. Something is wrong. NOTE: The page exists.

  • What is the error message?

  • No mistakes, just don’t redirect. I believe that there is something wrong with the bar and the quotes at the end before the "target", I have tried several times but without success. Something is wrong. NOTE: Page exists.

  • 3

    @Andreeh better describe the functionality of this code, what should he do that is not doing? post a larger chunk of your code that allows us to run tests and so on.

1 answer

3


In that part:

 & #calendario "' target='blank'>" &

You are trying to concatenate a variable #calendario. This is an invalid name for a variable in Vbscript, so it cannot exist.

Even if it was valid, the Strings (&) concatenation operator is missing between this supposed variable and the next string.

#calendario "' target='blank'>" &
^ erro        ^ aqui falta o operador &

If #calendário is actually an anchor of the link, so the correct code should be:

ind = ind & "<span>- <a href='" & vStrParametro7 & "/Busca/" & rsQuery("ID_CURSO") & "/#calendario' target='blank'>" & rsQuery("DT_INICIO") & " à " &rsQuery("DT_FIM") & "</a></span>"
  • this "#calendar" is a part of the page to be redirected to when clicking on the link. The link has to look like this: "www.seila.com.br/00000055/calendar". The number is rsQuery("ID_CURSO"). until then beauty, but the rest does not take,

  • I edited my answer, take a look.

  • Fine, I’ll try @Marcusvinicius. Thank you.

  • It worked, thanks @Marcusvinicius

Browser other questions tagged

You are not signed in. Login or sign up in order to post.