1.在web.config中:
<appSettings>
<add key ="url_house" value="hid"/>
</appSettings>
2.在urlHouse.aspx.cs中:
public string url_house;
protected void Page_Load(object sender, EventArgs e)
{
url_house = ConfigurationManager.AppSettings["url_house"];
}
3.在urlHouse.aspx中:
<head runat="server"><title>结果显示</title>
<script language="javascript" src="js/urlHouse.js" type="text/javascript"></script>
<script language="javascript">
function Init_urlHouse()
{
url_house="<%=url_house%>";
}
</script>
</head>
可不可不经过后台cs,直接在javascript中调用啊。 要经过后台的。js不能直接调用的。