我有一個MVC項目,我有一個全局函數返回url的。這裏是其中之一:訪問資源文件中的全局變量
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Account.Models
{
public class ApplicationStrings
{
public static string ApplicationString(){
return "http://localhost11234/Studentbook";
}
}
}
我有資源文件,我存儲電子郵件正文爲不同的電子郵件出去。這是一個嵌入式資源。
如何從我的資源文件中的全局函數中訪問URL?
我嘗試以下方法,但沒有看到鏈接:
<html>
<body>
<br> Student ID : <a href= ApplicationStrings.ApplicationString() + ?id=JD1123>JD1123</a><br>
</body>
</html>
我看到以下內容:
Student ID : JD1123
這裏JD1123是一個鏈接,該鏈接帶我到「ApplicationStrings.ApplicationString ()「而不是」http:// localhost11234/Studentbook?id = JD1123「