Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 527749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:54:57+00:00 2026-05-13T08:54:57+00:00

How do I disable an if the user is not logged in? <asp:MenuItem NavigateUrl=~/Customizations.aspx

  • 0

How do I disable an if the user is not logged in?

<asp:MenuItem NavigateUrl="~/Customizations.aspx" Text="Customizations" Enabled="<%# Page.User.Identity.IsAuthenticated %>" />

Doesn’t work, even if I specify Page.DataBind() in the Page_Load method.

<% if (HttpContext.User.Identity.IsAuthenticated) { %>
    <asp:MenuItem NavigateUrl="~/Customizations.aspx" Text="Customizations" />
<% } %>

Gives the error: Parser Error Message: Code blocks are not supported in this context.

I tried adding an ID attribute, and it gives an error saying it isn’t a supported attribute.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:54:57+00:00Added an answer on May 13, 2026 at 8:54 am

    While trying to make webforms like winforms, Microsoft came up short and hasn’t faithfully represented a lot of the properties in the winforms MenuItem object, specifically the Visible property. They’ve also sealed the class barring the ability to work around this oversight through polymorphism.

    It would be brilliant to be able to do something like this:

    <asp:MenuItem NavigateUrl="~/Customizations.aspx" Text="Customizations" Visible="<%# HttpContext.User.Identity.IsAuthenticated %>/>
    

    You’re unfortunately probably going to have to resort to either building or modifying your list in the code-behind.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If the user has not logged into facebook, the comments plugin provides an option
I am using user controls to display some content on a asp.net page.And I
Details: Only disable after user clicks the submit button, but before the posting back
We need to conditionally disable GZIP compression if user's browser is IE6 (it hangs
How can I disable my iPhone app sound if the user is playing iPod
I'm trying to disable/enable controls based on user permission using a custom security framework
I'm trying to disable MVC3 controls dynamically based on the user's permission. It works
I have to disable and enable three checkboxes. if the user clicks on one
What is the easiest way to disable an entire HTML page until an initial
I am needing to detect when a user is inactive (not clicking or typing)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.