English 中文(简体)
查阅主页超链接
原标题:accessing master page hyperlink from a different controller

我正在使用协会。 NET 3.0 MVC, 会员提供商。 我必须修改与成员资格有关的法典,以履行违约义务。 我必须在主页上移动LogOff 超链接。 起初,这种联系是看不到的,但一旦认证是可笑的,我就需要加以说明。 这一行动将由主计长进行认证,我无法确定如何从不同的控制人员进入总页上确定的超链接。 如何做到这一点,如何保持多国旅委会设计的精神?

最佳回答

你可以在你的账户主计长中采取另外一项行动,以确定是否需要展示离心连接。 这一行动在html中占有一席之地。 从主页呼吁采取这一新行动,如果需要显示离心联系的话,则检查这一行动。

 @{ Html.RenderAction("displayLogOff", "Account"); }
问题回答

我不敢肯定,为什么你需要作修改,因为这似乎是违约行为,但通常你会用部分观点显示超文本链接的标志。 这种部分观点可以付诸行动,在这一行动中,如果用户目前得到认证,你将发出一种可以包括国旗的观点。 或者,你只能检查请求。 部分内容直接说明。

I m not sure I understand. The default implementation already does this. It works regardless of what controller you re using. The reason is that the master page uses a partial page that specifies the method and controller.





相关问题
Default Membership and User Profiling vs Custom ones

I was just going through the "AccountController.cs" code (the default one which appears when you create a new ASP.NET MVC project). When I tried to compare it to the one that is proposed in my book, I ...

What is the simplest way to create my own FTP server?

What is the simplest way to create my own FTP server in C#? Some of the folders will be virtual folders. The authentication should be from a SQL Server database, which includes tables of the ASP.NET ...

MembershipProvider in .NET 4.0

How can I add the MembershipProvider class to my .NET 4.0 project in VS 2010 B2? I want to customize a MembershipProvider, but I cannot without adding this class. Please guide me through this process....

ASP.Net Session Not Invalidated After Logout

I have a ASP.Net application in my login page I call FormsAuthentication.SignOut Session.Abandon() Session.Clear() however the Appscan is taking the ASPXAUTH cookie value then after logout is ...

热门标签