C# 我们如何从控制器到普通html获取值
如何从controller到纯HTML获取C# 我们如何从控制器到普通html获取值,c#,html,asp.net,model-view-controller,entity-framework-4,C#,Html,Asp.net,Model View Controller,Entity Framework 4,如何从controller到纯HTML获取\u m.Url的值 EmailModel _m = new EmailModel(); if (Ads.Email != null) { _m.toAddress.Add(Ads.Email); _m.Url = "http://www.bedspacefinders.com/PostBedAds/AllPostBeds/" + be.AdvertisementID; _m.Subject = "Welcome Your Ads
\u m.Url
的值
EmailModel _m = new EmailModel();
if (Ads.Email != null)
{
_m.toAddress.Add(Ads.Email);
_m.Url = "http://www.bedspacefinders.com/PostBedAds/AllPostBeds/" + be.AdvertisementID;
_m.Subject = "Welcome Your Ads is Live ";
_m.Body= System.IO.File.ReadAllText(Server.MapPath("~/EmailTemplate/EmailFormat.html"));
}
我想把这个值
\u m.Url
放在这个HTMLli
中,我不确定我是否理解。您可以试着详细说明一下吗?您应该能够通过Razor绑定语法来理解如何将HTML项绑定到数据源。我会先从这里开始,然后再介绍更多细节。@PeterBons我在控制器中有值,比如_m.Url。所以我想把这个值转换成普通的HTML段落,以显示这个值是动态变化的,所以我不想使用Razor视图。我希望在段落中的纯HTML中使用此值。