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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:16:44+00:00 2026-05-15T07:16:44+00:00

Simple question, if you use the Html Helper from ASP.NET MVC Framework 1 it

  • 0

Simple question, if you use the Html Helper from ASP.NET MVC Framework 1 it is easy to set a default value on a textbox because there is an overload Html.TextBox(string name, object value). When I tried using the Html.TextBoxFor method, my first guess was to try the following which did not work:

<%: Html.TextBoxFor(x => x.Age, new { value = "0"}) %>

Should I just stick with Html.TextBox(string, object) for now?

  • 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-15T07:16:45+00:00Added an answer on May 15, 2026 at 7:16 am

    It turns out that if you don’t specify the Model to the View method within your controller, it doesn’t create a object for you with the default values.

    [AcceptVerbs(HttpVerbs.Get)]
    public ViewResult Create()
    {
      // Loads default values
      Instructor i = new Instructor();
      return View("Create", i);
    }
    
    [AcceptVerbs(HttpVerbs.Get)]
    public ViewResult Create()
    {
      // Does not load default values from instructor
      return View("Create");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple question: if I use URLConnection.setUseCaches(true) when loading something from web,
Simple question. I'm new to Clojure. How can I use one file from my
Context I want to use JavaFx with clojure. I am aware of http://nailthatbug.net/2011/06/clojure-javafx-2-0-simple-app/ Question:
Apologies, I'm new to ASP.NET MVC. :) I'm unsure if this is simple a
Simple question. How can I use .NET to traverse the directory structure of a
Really a simple question. I tried to use jquery to insert html table rows.
I've been looking a lot recently as best practices within the ASP.NET MVC framework,
Simple question. Why use require_once to include classes that you use within a file?
Simple question I guess, I want to use PHP to write an update to
i have a simple question. if i use play.db.ebean.Model to have my Model extend

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.