转义字符问题

来源:百度知道 编辑:UC知道 时间:2024/06/08 02:35:34
html代码中<label onclick="GetList(<%=pagesize %>,<%=i %>,'<%=strwhere %>');">
这个获得分页的数据
cs代码中strwhere = " FictionName like '%" + Info + "%'";
因为strwhere里已经有''号,所以在html代码中'<%=strwhere%>'会报js错误'号重了,如何让<%=strwhere%>转换成字符串型而且不用''号转换

<label onclick="GetList(<%=pagesize %>,<%=i %>,'<%=strwhere %>');">

为什么喜欢在ASP里面搞HTML,坏习惯,下面这样更容易理解:

response.write "<label onclick=""GetList("&pagesize&","&i&",'"&strwhere&"');"">"