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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:37:48+00:00 2026-05-26T03:37:48+00:00

I developed a editor template wich take boolean types and creates a dropdownlist, to

  • 0

I developed a editor template wich take boolean types and creates a dropdownlist, to changed the true and false default values, into Si and No. Now when I deployed the application i didn’t realized that the boolean and Nullable<boolean> are taken like the same and affected for the name of my editor template (boolean.cshtml). Now I don’t want this, I want to modify the behavior of the editorfor, only when the datatype of the model was Nullable<boolean> not when it’s boolean. How can I handle this???

 @model Nullable<bool>

@{
    var listItems = new[]
    {
        new SelectListItem { Value = "true", Text = "Si" },
        new SelectListItem { Value = "false", Text = "No" }
    };  

}


@Html.DropDownListFor( model => model.Value, listItems)
  • 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-26T03:37:49+00:00Added an answer on May 26, 2026 at 3:37 am

    You can’t prevent them using the same editor template. But you can handle it within the editor template. You have:

    ViewData.ModelMetadata.IsNullableValueType
    

    If you read this article, you can actually see what the default template does with this to switch between two different renderings. Just steal from it:

    http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-3-default-templates.html

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

Sidebar

Related Questions

I am writing a custom editor in a plugin, and I developed it in
Is there any Grammar editor utility for context-free grammars developed in Java?
On Visual Studio.NET 2010/localhost, an ASP.NET page developed with Devexpress editor and textbox controls
I am trying to implement RequestFactory and the Editor framework into my app. I'm
I developed a web application using IE9 and a text editor. It reads a
I have developed an editor using java Jpanel, component, etc....I have 2 text areas
I developed a Sitecore control I'd like to put into a layout on one
I'm designing a cross-platform map editor for an application I've developed, and I'm unsure
I am trying to develop an Online editor (like FCKEditor/etc) but I have no
We developed a website for a client and he has purchased the .com, .net,

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.