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 6226183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:58:41+00:00 2026-05-24T08:58:41+00:00

Right, please don’t point me there: Disable a HyperLink from code behind My problem

  • 0

Right, please don’t point me there:
Disable a HyperLink from code behind

My problem is as follows.
I have a hyperlink on my aspx page:

<asp:HyperLink Visible='<%= _myUser.hasPermission("Intranet Management")%>' Text="Intranet Management" runat="server" NavigateUrl="/Apps/Admin/Default.aspx" />

_myUser.hasPermission("Intranet Management") returns boolean with value of TRUE or FALSE depends if a current user has that permission or not. _myUser is declared in aspx.cs file as protected member so I am able to access it from aspx file.

On my page I am getting following error:

Parser Error Message: Cannot create an object of type ‘System.Boolean’
from its string representation ‘<%= _myUser.hasPermission(“Intranet
Management”) %>’ for the ‘Visible’ property.

Is there any other way of doing that in aspx file? Please don’t ask me to do it in the code behind, I have my reasons to do it here…

Thanks for any help.

  • 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-24T08:58:42+00:00Added an answer on May 24, 2026 at 8:58 am

    The problem you’re facing is that asp:Hyperlink is a server control, and these wont evaluate code inside <%= %> for their properties. They will databind though IIRC, so you could try

    <asp:HyperLink Visible='<%# _myUser.hasPermission("Intranet Management")%>'...
    

    And make sure to call Page.DataBind().

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

Sidebar

Related Questions

Could somebody please point me in the right direction for learning how to do
it's assembler right? can someone please point out the progression that we've had in
Please pardon my ignorance. I'm looking for a point in the right direction. I
Please note - I am not looking for the right way to open/read a
Right - to start with, I'm entering unfamiliar areas with this - so please
New to MVVM so please excuse my ignorance. I THINK i'm using it right
I'm just fiddling around with user scripts in chrome right now, so please bear
I know I'm not asking this quite right, either. Please help me better form
For instance, the app could say something like, Please wait. or I'll be right
Please don't mind about the syntax. I thought of making the post as brief

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.