开发者

ASP.NET WebForms view engine unable to parse server-side tag

I have the following line in an MVC view:

<meta name="msapplication-starturl" 
    content="<%= Url.BaseServerHttpUrl() + gaPinningCampaign %>" />

This simply renders out:

 <meta name="msapplication-starturl" 
     content="&lt;%= Url.BaseServerHttpUrl() + gaPinningCampaign %>" />

The way I found round it was to prepend an empty string do this:

<meta name="msapplication-starturl" 
     content="<%= "" + Url.BaseServerHttpUrl() + ga开发者_JAVA百科PinningCampaign %>" />

Any ideas why the parser is getting confused and what a cleaner way to get around this would be?


Just remove runat="server" from head tag,

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜