开发者

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

开发者 https://www.devze.com 2023-03-23 09:58 出处:网络
I have the following line in an MVC view: <meta name=\"msapplication-starturl\" content=\"<%= Url.BaseServerHttpUrl() + gaPinningCampaign %>\" />

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

精彩评论

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