Hanah George
Hanah George

Reputation: 23

How to concatenation href value

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?

Upvotes: 1

Views: 39248

Answers (2)

lboshuizen
lboshuizen

Reputation: 2786

<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...

Upvotes: 7

Patrick Dubois
Patrick Dubois

Reputation: 47

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 %>" />

Upvotes: -2

Related Questions