如何只为ASP.NET网站的一页自定义用户控件? [英] How to customize the user control for only one page of the ASP.NET website?

查看:55
本文介绍了如何只为ASP.NET网站的一页自定义用户控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个用户控件(ascx);一种包含某些形式,另一种包含菜单栏.

我在很多页面上都使用了它们.现在,我需要自定义具有管理主页"菜单栏的菜单栏.因此,是否可以仅为此页面在用户控件中添加一些更改.

我的意思是通过更改,在菜单栏中添加两个元素.

例如,让我们假设这两个页面被称为:管理员",设置".您将如何为他们自定义用户控件?

顺便说一句,由于我使用的是Windows身份验证,所以我使用的是ASP.NET基于角色的安全性.这是从普通用户定义管理员.

I have two user controls (ascx); one contains some forms, and the other one contains the menu bar.

I used both of them in many pages. Now, I need to customize the one that has the menu bar for the Admin Homepage. So, is it possible to add some changes to the user control just for this page.

I mean by changes, adding two elements to the menu bar.

For instance, let us assume that the two pages are called: Admin, Settings. How will you customize the user control for them?

By the way, I am using the ASP.NET Role-Based Security since I am using the Windows Authentication. This to define the Admin from the Normal User.

推荐答案

您无需自定义用户控件,只需定制菜单即可,只需修改即可基于页面或用户角色的菜单项.不知道您是如何构建菜单的,就很难给出具体的信息.
You don''t need to customize the user control, only the menu, and that can be done by modifying the the menu items based on the page or user role. Without knowing how you are constructing the menu it would difficult to give specifics.


这篇关于如何只为ASP.NET网站的一页自定义用户控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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