How to concatenation href value

2019-06-11 06:53发布

问题:

I have got asp classic page and i need to show link with some value on the page.

Here is the link and i need to attach strEmpcode with the address.

strEmpcode = session("empcode")

 <td><li>
    <a href="http://192.1.1.1:85/reports.aspx?empcode= & strEmpcode"> Report</a>
 <td><li>

So on click it should pass the address in this form:

http://192.1.1.1:85/reports.aspx?empcode=123

I need to show it on design time (inline page) not on runtime.

How can i fix it?

回答1:

<a href='http://192.1.1.1:85/reports.aspx?empcode=<%=strEmpcode %>'> Report</a>

Just to concatenate strEmpcode to the URL. Where that var gets a value is not clear from your question now...



回答2:

You can concatenate directly in the server side code

EDIT: You can still build a concatenate string in the ASP server side code.

<%
   var mylink = "..." + "..."
 %>


<a href="<%=mylink %>" />


标签: asp-classic