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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:23:56+00:00 2026-05-24T19:23:56+00:00

In my view I disable or enable links as below. Even if the link

  • 0

In my view I disable or enable links as below. Even if the link “Insured or Owner Name Change” is disabled in the view I am able to access it through the url like “http://localhost:0000/NameChangeRequest?contract=111111” which should not be happening. Can anyone help me on this?

           @if (Model.CanCreateNameChangeRequest)
                    {
                        @Html.ActionLink("Insured or Owner Name Change", "Index", "NameChangeRequest", new { @contract = Model.ContractNumber }, new { @class = "requestLink" });
                    }
                    else
                    {
                        <span class="requestLinkDisabled">Insured or Owner Name Change</span>
                    }
  • 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-24T19:23:57+00:00Added an answer on May 24, 2026 at 7:23 pm

    You should never use Views to handle access control or any nature of business logic really. The View should only have presentation layer logic and markup.

    That said, you can do this in the “NameChangeRequestController” -> “Index” action:

    public ActionResult Index()
    {
        if(!Model.CanCreateNameChangeRequest)
            RedirectToAction("Index","Home");
    }
    

    Also, this looks a lot like Role based permissions, in which case you should use the “[Authorize]” attribute along with “IsInRole”.

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

Sidebar

Related Questions

Please view image of Google maps fig 1. from the link below: http://www.androidpatterns.com/uap_pattern/search-%E2%80%93-main-menu Currently
I have tried using the code mentioned in the link below to mass disable
Is there a way to enable/disable the View Whitespace feature in Visual Studion on
I believe I have disabled the view state on all controls as well as
View Looks Like This <?=form_open_multipart('upload/process');?> <input type=file multiple=multiple name=userfile[] id=userfile /> <?=form_submit('upload', 'Upload');?> <?=form_close();?>
My view is that unless you need to change the basic structure of the
I want to enable/disable a checkable item in a QTreeWidget, when a specific signal
I am simply attempting to use a checkbox to enable/disable an NSTextField. I have
Currently, I'm running an app I'm developing on Apache/Passenger. I was able to view
I have a UserMailer View that has several link_to's like so: <%= link_to('XXXXXXXX Link

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.