title: Adding model with user input and hard coded values
body: <p>Okay so I am using the MVC framework. I have a view for adding a model. At the moment I am using the default "Create" controller. </p>
  
  <p>I want to be able to create a model with my own variables pre-set. For example the model.UserId I want to set to the users Id. I want some values to be inputed by the user and I want some to be already set. Is there a way I could do something like this</p>
  
  <p>(pseudo code)</p>
  
  <pre><code>model.matchId = 123
  model.prediction type = "user input"
  add model 
  </code></pre>
  
  <p>here is my current code below</p>
  
  <pre><code>@using (Html.BeginForm()) {
  @Html.ValidationSummary(true)
  
  &lt;fieldset&gt;
      &lt;legend&gt;Predictions&lt;/legend&gt;
  
      &lt;div class="editor-label"&gt;
          @Html.LabelFor(model =&gt; model.MatchId, "Match")
      &lt;/div&gt;
      &lt;div class="editor-field"&gt;
          @Html.DropDownList("MatchId", String.Empty)
          @Html.ValidationMessageFor(model =&gt; model.MatchId)
      &lt;/div&gt;
  
      &lt;div class="editor-label"&gt;
          @Html.LabelFor(model =&gt; model.UserId, "User")
      &lt;/div&gt;
      &lt;div class="editor-field"&gt;
          @Html.DropDownList("UserId", String.Empty)
          @Html.ValidationMessageFor(model =&gt; model.UserId)
      &lt;/div&gt;
  
      &lt;div class="editor-label"&gt;
          @Html.LabelFor(model =&gt; model.Type)
      &lt;/div&gt;
      &lt;div class="editor-field"&gt;
          @Html.EditorFor(model =&gt; model.Type)
          @Html.ValidationMessageFor(model =&gt; model.Type)
      &lt;/div&gt;
  
      &lt;div class="editor-label"&gt;
          @Html.LabelFor(model =&gt; model.Prediction)
      &lt;/div&gt;
      &lt;div class="editor-field"&gt;
          @Html.EditorFor(model =&gt; model.Prediction)
          @Html.ValidationMessageFor(model =&gt; model.Prediction)
      &lt;/div&gt;
  
      &lt;p&gt;
          &lt;input type="submit" value="Create" /&gt;
      &lt;/p&gt;
  &lt;/fieldset&gt;
  </code></pre>
  
  <p>}</p>