js代碼:
//搜索跳轉至中轉頁
function Search(id) {
var Sou1 = document.getElementById('Sou1')
var T1 = Sou1.value;
if (id == "1") {
if (Sou1.value != "") {
top.location.href = 'web/Search.aspx?S=1&T=' + T1;
}
}
}
C#類代碼:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;
/// <summary>
///myConfig 的摘要說明
/// </summary>
public class myConfig
{
public myConfig()
{
//
//TODO: 在此處添加構造函數邏輯
//
}
public static string webUrl
{
get
{
return ConfigurationManager.AppSettings["webUrl"];
}
}
}
問的什麼東東。。。動態調用用ajax發送請求,如果要獲取返回值用服務器端標簽
<script>
var url= <%=myConfig.webUrl%>
</script>