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

  • Home
  • SEARCH
  • 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 394473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:21:33+00:00 2026-05-12T16:21:33+00:00

I am passing a optionLabel into the Html.DropDownList helper (taken from this SO question):

  • 0

I am passing a optionLabel into the Html.DropDownList helper (taken from this SO question):

<%=Html.DropDownList("PO.Vendor.VendorId", this.Model.Vendors, "-- add a new vendor --")%>

That produces markup with an option of value 0 with the text “– add a new vendor –“, which is exactly what I want. However, if that option is selected and posted, a validation error is thrown.

Is there way to turn off this automatic validation when using an optionLabel?

  • 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-12T16:21:33+00:00Added an answer on May 12, 2026 at 4:21 pm

    The code snippet that you posted doesn’t have anything to do with the validation being performed. You could easily just write out all the options in the list manually and you’d still be getting the validation error.

    Without seeing the code that is performing the validation, it’s hard to tell you how to turn it off. If you’re using the reflection-based “UpdateModel()” like in NerdDinner, you’ll need to add some code to remove/change that posted value.

    Wherever your validation code is, you’ll have to work something out to ignore that value.

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

Sidebar

Related Questions

Passing a Enum value as a parameter from JSF This question already deals with
I am passing a string from objective C to javascript in this way -
Passing data from a controller to another controller. this is what i am doing,
warning: passing argument 1 of 'bsearch' makes pointer from integer without a cast and
I'm passing a map of strings from native c++ class to c# using c++/CLI.
I'm passing as parameter an id to a javascript function, because it comes from
Passing data (simple string) from Controller to View I have in my controller: public
error: passing 'const QByteArray' as 'this' argument of 'QByteArray& QByteArray::append(const QByteArray&)' discards qualifiers [-fpermissive]
When passing a delegate to MyClass like this, - (MyClass *)initWithDelegate:(id <MyDelegate>)delegate {..} is
When passing a view model (as below) to a view, how can I ensure

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.