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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:51:59+00:00 2026-05-18T01:51:59+00:00

I have some ASP.NET (MVC2) auto generated html which is creating forms looking like

  • 0

I have some ASP.NET (MVC2) auto generated html which is creating forms looking like this:

This is because say each of the drop downs is a list of strings, some string in that drop down is long/short.

What I want to do is make them all the same size, or at least clean this form up in some way.

I’m guessing I can inspect the rendered html, and use css on that to do the job maybe.

Any suggestions / css code ?

Cheers

EDIT:

So it seems to use a editor template you need to add metadata to the classes.

How do you do this if you have used Entity Data Model (and it is all generated for me) and I have a DataModel.edmx and DataModel.Designer.cs – where does the metadata tags go ?

  • 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-18T01:52:00+00:00Added an answer on May 18, 2026 at 1:52 am

    Yes. It’s probably best to add classes to your input fields:

    <%: Html.TextBoxFor(m => m.FirstName, new { @class = "form-input-w100" }) %>
    

    Then, in a css file, you’d specify a width:

    input.form-input-w100 { width: 100px; }
    

    If you want to maintain granular control over the styling of your forms, I’d suggest that you stray away from the default Editor Templates. They’re not super css-friendly. Alternately, you can create your own style-friendly Editor Templates (as described here: http://www.weirdlover.com/2010/07/15/the-big-boy-mvc-series-part-24-dear-editortemplates-are-we-done-posting-yet/).

    And, to top it all off, you CAN force a width on all the objects in a form, even if the form is not marked up well, but I do NOT recommend this kind of approach. I’ll give it to you anyways:

    #pageArea form input[type=textbox] { width: 100px; }
    #pageArea form select { width: 140px; }
    

    Etc.

    Hope that helps!

    P.S. If you need more info about styling–check out http://net.tutsplus.com/tutorials/html-css-techniques/the-30-css-selectors-you-must-memorize/

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

Sidebar

Related Questions

No related questions found

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.