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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:26:08+00:00 2026-05-18T23:26:08+00:00

Consider this code: <%: Html.DisplayFor(model => model.SomeBoolean)%> <%: Html.DisplayFor(model => model.SomeInt)%> First one is

  • 0

Consider this code:

<%: Html.DisplayFor(model => model.SomeBoolean)%>

<%: Html.DisplayFor(model => model.SomeInt)%>

First one is bound to a boolean this will render a disabled drop down list.
The second is bound to an int and this will simply render the result as text.

I would like the int to also render a drop down list too.

What are my options?

Many thanks.

  • 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-18T23:26:09+00:00Added an answer on May 18, 2026 at 11:26 pm

    MVC has a set of default editor and display templates. You can create your own by creating a DisplayTemplates folder in either the view folder for the controller, or you can define a more global template by putting it in a DisplayTemplates folder in the Shared folder.

    For system types, use the actual type name and not the language specific shortcut (i.e. for int, call the template Int32.ascx or Int32.cshtml for Razor.

    You can further specify templates by either using an overload (I know this is possible for EditorFor, I’m guessing it is for DisplayFor as well), or if you have a specific property that you want to use a different template for, you can use data annotations.

    This same technique works for complex types as well.

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

Sidebar

Related Questions

consider this html code <textarea> <object> <embed></embed> <div></div </object> </textarea> If i issue the
Please, consider this code: <script> $(function(){ $('#clickme').click(function(){ $('#note_pag').html('<div id=note_pag><ul><li><b>1</b></li><li><a href=2>2</a></li></ul></div>'); }); $('#note_pag a').click(function(){ alert($(this).attr('href'));
Consider this code : HTML: <div class='a'>a</div> <div class='b'>b</div> <div id='log'></div> CSS: .a, .b
Consider this code : HTML: <table> <tr> <td>Option 1</td> <td><input type='checkbox' id='option1' /></td> </tr>
Please consider this code here, also given is this fiddle: http://jsfiddle.net/DPNc6/ HTML: <div style=width:500px
Consider this HTML: <div id=entry-content> <div id=my-300px-ad>AD CODE HERE</div> <p><img src=file.jpg alt=file /></p> <p>SOME
Consider this code: enum { ERR_START, ERR_CANNOTOPENFILE, ERR_CANNOTCONNECT, ERR_CANNOTCONNECTWITH, ERR_CANNOTGETHOSTNAME, ERR_CANNOTSEND, }; char* ERR_MESSAGE[]
Consider this code in a php file on my VPS server: <?php $url =
Consider this code: if(initscr() == NULL) ERROR(Cannot start ncurses mode.\n); keypad(stdscr, TRUE); cbreak(); int
Consider this code: char buffer[] = abcdefghijklmnopqrstuvwxyz, *val = malloc(10), *pbuf = buffer, *pval

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.