如何单独显示管理部分和主站点部分? [英] How to show the Admin section and main site section separately?

查看:80
本文介绍了如何单独显示管理部分和主站点部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!全部,

我的网站有一个管理部分文件夹,我可以在管理部分进行一些更改,同样会反映在我的网站上,我想要做的是我想打开我的管理员网站按以下方式。



1)http:// localhost:9180 / testsite / admin / login.aspx我的管理部分

它位于admin文件夹下的网站内。



,主站点应该打开

2)http:// localhost:9180 /testsite/Index.aspx。

我对如何实现这个感到困惑?

解决方案

Nischal,

,因为你已经正确地构建了它,但需要进行一些微调。

重命名login.aspx - > default.aspx

在admin文件夹下的母版页面上创建,并从该母版页链接您希望提供给管理员的所有其他页面。

一旦用户登录,维护具有角色,用户ID的会话,并在注销时清除它。

页面加载主页面事件,检查会话值以及何时清除/ null然后重定向到default.aspx



这些几步,如果你这样做,那么分开管理页面会更容易。其他用户登录/文件夹也可以应用相同的步骤。



快乐编程

anurag


simpple !!



在根网页配置文件中添加以下内容



 <   location     path   = 管理员 >  
< system.web >
< 授权 >
< allow < span class =code-attribute> users = * / >
< / authorization >
< / system.web >
< / location >


Hello! All,
I have an admin section folder for my website where I can do some changes in the admin section and the same would reflect on my website, what I want to do is I want to open my admin site in the following manner.

1) http://localhost:9180/testsite/admin/login.aspx for my admin section
It is inside the website under admin folder.

and the main site should open as
2) http://localhost:9180/testsite/Index.aspx.
I'm confused about how to achieve this?

解决方案

Well Nischal,
since you have already structured it proper but a little fine tuning is needed.
Rename login.aspx -> default.aspx
Create on master page under admin folder and link all other pages which you wish to make available to admin from that master page.
once user logs in, maintain session with role, user id and clear it when logs out.
on page load event of master page, checks for session values and when it is clear / null then redirect to default.aspx

these are few steps, if you do it then it would be easier to separate admin pages. Same steps can be applied other user login / folders also.

happy programming
anurag


simpple!!

add below in root web config file

<location path="Admin">
        <system.web>
            <authorization>
                <allow users="*"/>
            </authorization>
        </system.web>
    </location>


这篇关于如何单独显示管理部分和主站点部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆