您可以在母版页使用Url.Content() [英] can you use Url.Content() in a master page
本文介绍了您可以在母版页使用Url.Content()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不断收到编译错误,当我尝试这样做。 。是反正有做到这一点的Site.Master文件中?
i keep getting Compilation errors when i try to do this . .is there anyway to do this inside the site.master file?
推荐答案
你加母版页作为一个MVC母版页?
Did you add the master page as an MVC master page?
这you'rew试图使用网址
财产来源于MVC框架的 ViewMasterPage
类。如果添加了常规母版页,你需要使它从 ViewMasterPage
继承。要做到这一点,第一行改为
The Url
property that you'rew trying to use comes from the MVC framework's ViewMasterPage
class. If you added a regular master page, you need to make it inherit from ViewMasterPage
. To do this, change the first line to
<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
这篇关于您可以在母版页使用Url.Content()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文