title: ASP.net MVC pass some data from view to controler
body: <p>In view I have ListBox so user can select some data. I also have MultiSelectList for same reason.
  User can choose some date from MultiSelectList  or he doesn't have to (he can leave that field  blank). And that worked fine.
  I've decided to add TextBox so user can enter data if he wants. Now when user enters data to TextBox and doesn't choose any data from MultiSelectList  everything is fine.</p>
  
  <p>But ! If user chooses data from MultiSelectList  and leaves TextBox empty I get this error:</p>
  
  <pre><code>The ViewData item that has the key 'CompetitionId' is of type 'System.Int32' but must be       of type 'IEnumerable&lt;SelectListItem&gt;
  </code></pre>
  
  <p>And that error is showed for LisBox.</p>
  
  <p>I have same problem with another view / controller. I've enabled option for user to upload image, and if he doesn't click on choose image, and uploads image I get same error for another ListBox in that view .</p>
  
  <p>Please help me to slove this. Here is code for first controller  / view</p>
  
  <p>Controller: </p>
  
  <pre><code>[Authorize]
      public ActionResult Create()
      {
          ViewBag.Competitions = new SelectList(_competitionRepository.GetAllCompetitionsAndNotActive().AsEnumerable(),
                                                "CompetitionId", "Name");
          ViewBag.Tags = new MultiSelectList(_tagRepository.GetAllTags().AsEnumerable(), "TagId", "Name");
  
  
  
          return View();
      }
  
      //
      // POST: /Advert/Create
  
      [HttpPost, Authorize]
      [AcceptVerbs(HttpVerbs.Post)]
      public ActionResult Create(AdvertDTO advertDTO, int [] tags, int competitionId, string inputTags)
      {
          if (ModelState.IsValid)
          {
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>@using (Html.BeginForm()) {
  @Html.ValidationSummary(true)
  
  &lt;fieldset&gt;
      &lt;legend&gt;Advert&lt;/legend&gt;
  
  
      &lt;div class="editor-label"&gt;
          Choose Competition
      &lt;/div&gt;
      &lt;div class="editor-field"&gt;
          @Html.DropDownList("CompetitionId", (SelectList)ViewBag.Competitions, new { @class = "chzn-select", data_placeholder = "Choose  Competitions...", style="width:350px;" } )           
          @Html.ValidationMessageFor(model =&gt; model.CompetitionId)
      &lt;/div&gt;      
      ....     
      @Html.ListBox("Tags", (MultiSelectList)ViewBag.Tags, new { @class = "chzn-select", data_placeholder = "Choose  Tags...", style="width:350px;" })
  
  
         &lt;br/&gt;
         &lt;label&gt;OR&lt;/label&gt;
         &lt;input type="text" id="inputTags" name="inputTags" style="width: 325px" /&gt;
  
      &lt;p&gt;
          &lt;input type="submit" value="Create"  /&gt;
      &lt;/p&gt;
  &lt;/fieldset&gt;
  </code></pre>
  
  <p>}</p>
  
  <p><strong>EDIT</strong>
  Long story short I want user to be able tu submit empty fields</p>