How to concatenation href value

巧了我就是萌 提交于 2019-12-08 14:42:31

问题


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


来源:https://stackoverflow.com/questions/12802693/how-to-concatenation-href-value

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!