躲在asp.net链接 [英] hiding a link in asp.net

查看:127
本文介绍了躲在asp.net链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在以下master.cs code .....

in the following master.cs code.....

public partial class Default : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        BasePage page = (BasePage)Page;

        if (page.CurrentUser != null)
        {
            lblCurrentUser.Text = "<strong>" + page.CurrentUser.FullName + "</strong> - " + page.CurrentUser.CompanyName;

            if ((Session["CCFUser"] != null) && (bool.Parse(Session["CCFUser"].ToString()) == true))
            {
                ctrlLinkBar.AddLink("Issues Management", "AllIssues.aspx");
            }
            else
            {
                if (true) ctrlLinkBar.AddLink("Home", "Default.aspx");
                if (page.CurrentUser.Permissions.Issues()) ctrlLinkBar.AddLink("Issues Management", "AllIssues.aspx");
                if (page.CurrentUser.Permissions.Time()) ctrlLinkBar.AddLink("Time Management", "TimeEntryForm.aspx");
                if (page.CurrentUser.Permissions.Time()) ctrlLinkBar.AddLink("Time Filter", "TimeFilter.aspx");
                if (page.CurrentUser.Permissions.SVN() && !(this.Page is _Default)) ctrlLinkBar.AddLink("SVN", "SVN.aspx");
                if (true) ctrlLinkBar.AddLink("Profile", "ChangePassword.aspx");
                if (page.CurrentUser.Permissions.Administration()) ctrlLinkBar.AddLink("Administration", "Administration.aspx");
            }

        }
        else lnkLogout.Visible = false;
    }
    protected void lnkLogout_Click(object sender, EventArgs e)
    {
        Session.Abandon();
        FormsAuthentication.SignOut();
        Response.Redirect("Login.aspx");
    }
}

我需要隐藏链接时间过滤器,所以它没有出现在任何的网页内容的形式。
它没有一个id,所以我不能种姓它。我该如何去隐藏得呢?

i need to hide the link "Time Filter" so it doesnt appear on any of the web content forms. It doesnt have an id so i cannot caste it. How do I go about hiding it then?

推荐答案

如何编辑Master.cs不添加它,或仅添加某些时候?

How about editing Master.cs to not add it, or only add it some of the time?

如果不工作,那么你需要给我们更多的内容。

If that doesn't work, then you need to give us more context.

这篇关于躲在asp.net链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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