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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:31:50+00:00 2026-06-07T08:31:50+00:00

My MVC 3 application needs to create new users . I want to hard

  • 0

My MVC 3 application needs to create new users.

I want to hard code the ApplicationId for the ApplicationId text box in the view.

Does anyone know how to do this?

The create method does not fetch any data:

public ActionResult Create()
{
    return View();
}


  <div class="editor-label">
            @Html.LabelFor(model => model.ApplicationId)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ApplicationId)
            @Html.ValidationMessageFor(model => model.ApplicationId)
        </div>

Update

There is an option. To use a hidden field.

    @Html.Hidden("ApplicationId", "ep006964-83a8-4f40-a569-d2d3296f005b")
  • 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-06-07T08:31:52+00:00Added an answer on June 7, 2026 at 8:31 am

    Sure, in the controller action serving this view, you simply set the corresponding property on your view model:

    public ActionResult Foo()
    {
        var model = ... go and fetch your model from somewhere
        model.ApplicationId = "some hardcoded value";
        return View(model);
    }
    

    Now the EditorFor will display the correct value. There’s no way to force the value in the view. The whole point of editor templates is that they use the values that are set for your view model.

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

Sidebar

Related Questions

I' running a ASP.Net MVC 3 application on Azure. I simply create some users
I am using FckEditor in Create.aspx page in asp.net mvc application. Since I need
I need to create a web application using ASP.NET MVC, jQuery and web standards
I have an MVC application that needs to login and verify a user against
I am going to create a new web application that is very customized. It
I have an ASP MVC application which uses some silverlight applications in the View.
I have a spring MVC application using JSP as my view technologies with Jquery
I'm writing a new asp.net mvc application and I've been toying with the idea
I am expanding/converting a legacy Web Forms application into a totally new MVC application.
I need to create an ActionResult in an ASP.NET MVC application which has a

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.