<a>标签调用js方法出错(低级问题)
后台代码.cs
public string FuJian()
{
string url = "cd003e9c-c2c1-4630-8929-fcedec450a68-abcd.doc";
string str = "";
str = "<a href="javascript:show("" + url + "");">打开文档</a>";
return str;
}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default4.aspx.cs" Inherits="Default4" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function show(url) {
alert(url);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<%=FuJian()%>
</div>
</form>
</body>
</html>