2015年6月23日 星期二

aspx 抓 Web.config 值

有時網頁要抓取web.config 值.記錄一下方法.


簡單方法一:

1.1 Web.config   appseting 區塊. 寫下.
      

1.2 Aspx 頁面
     意見反應

這樣子就可以了.


後台寫法 方法二:

string engageUrl = System.Web.Configuration.WebConfigurationManager.AppSettings["EngageURL"].ToString();


            string script = string.Format("", engageUrl,  nob_contno);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "另開視窗", script, false);