本文介绍了您好如何重定向到垂直母版页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好如何重定向到特定页面.如果管理员密码和ID匹配,它应该重定向到管理员母版特定页面;或者如果用户登录密码和ID匹配,它应该重定向到用户母版特定页面. admin只能访问所有页面,而..user只能访问用户页面

hi how to redirect to particular page.if admin password and id matches it should redirect to admin masters particular page or if User login password and id matches it should redirect to User masters particular page.?can any one help..and admin only can access all pages and..user only can access user pages only

推荐答案

void Page_PreInit(Object sender, EventArgs e)
{
    this.MasterPageFile = "~/NewMaster.master";
}



从这里摘录:
http://msdn.microsoft.com/en-us/library/c8y19k6h.aspx [ ^ ]

因此,您可以在会话变量中设置母版页名称,以使每个页面都知道应将其分配给哪个母版页.

您必须根据用户访问类型更改该会话变量.

希望对您有所帮助.



Extracted from here :
http://msdn.microsoft.com/en-us/library/c8y19k6h.aspx[^]

So you can set a master page name in a session variable to let every page know to which master page they should be assigned.

You have to change that session variable based on user access type.

Hope it helps.




这篇关于您好如何重定向到垂直母版页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 03:59