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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:46:32+00:00 2026-05-20T02:46:32+00:00

I have lately read several articles and questions about Model Binding and Validation in

  • 0

I have lately read several articles and questions about Model Binding and Validation in asp.net MVC. What i have missed so far was the validation of a given foreign key id (drop-down list of related items for example).

If we consider the following situation:

There is an Entity (i.e. a Website Area) that features a set of folders, and the user is allowed to put entries into that folder, but only into the folders belonging to the Website Area the user has access to.

So what could be an elegant method to validate if the given foreign key value belongs to the set of folders that belong to the Website Area in question?

I assume it would be smart to perform this check by using a custom Model Binder and or a custom Validator which has access to the data repository?

  • 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-20T02:46:32+00:00Added an answer on May 20, 2026 at 2:46 am

    Why not just let the database do its work and let it validate FK’s. In your controller you can handle the error and display back to view as you see fit.

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

Sidebar

Related Questions

Lately I have been quite concerned about memory issues in ASP.NET. I have been
I have read a lot about the Java class loading process lately. Often I
I have been looking into different algorithms lately and have read quite alot about
I have lately been trying to read about how everything with strings and encodings
I have started learning VB.NET lately and have read 1 Step-By-Step beginners book and
Lately I have been reading a lot of blog topics about big sites(facebook, twitter,
Lately I have been reading about the Rack architecture in Passenger/Rails, and how it
I've read numerous discussions lately about different forms of security for mobile devices outside
I have been very excited about MongoDb and have been testing it lately. I
Lately I often have to read Java code like this: LinkedHashMap<String, Integer> totals =

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.