title: In the view if I select id I want to retrieve more than one columns from table to text directly
body: <p>Here I want to dynamically select the <code>electionName</code> once the user select the <code>electionId</code>.</p>
  
  <p>Model : </p>
  
  <pre><code>public virtual int ElectionId { get; set; }
  public virtual string ElectionName { get; set; }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>public ActionResult Index(votingModel chk)
  {
      var id = chk.ElectionId;
      if (db.votingModels.Find(id) == id)
      {
          // i want to do like this directly to the textbox is possible
          //string name = "select electionName from tabel where electionId =id";
      }
  </code></pre>
  
  <p>And as soon as the user entered the text of id directly the election name should appear in the view.</p>
  
  <p>View:</p>
  
  <pre><code> @model election.Models.votingModel
  
   @{
      ViewBag.Title = "index";
    }
   @using (Html.BeginForm())
   {
      @Html.AntiForgeryToken()
      @*&lt;p&gt;
          @Html.ActionLink("Create New", "Create")
      &lt;/p&gt;*@
      @Html.Label("election ID", htmlAttributes: new { @class = "control-label col-md-2" })
      &lt;div class="col-md-10"&gt;
          @Html.TextBoxFor(model =&gt; model.ElectionId, new { htmlAttributes = new { @class = "form-control" } })
          @Html.ValidationMessageFor(model =&gt; model.ElectionId, "", new { @class = "text-danger" })
      &lt;/div&gt;
      @Html.Label("election name", htmlAttributes: new { @class = "control-label col-md-2" })
      &lt;div class="col-md-10"&gt;
          @Html.TextBoxFor(model =&gt; model.ElectionName, new { htmlAttributes = new { @class = "form-control" } })
          @Html.ValidationMessageFor(model =&gt; model.ElectionName, "", new { @class = "text-danger" })
  
          @Html.Label("election Reason", htmlAttributes: new { @class = "control-label col-md-2" })
      &lt;div class="col-md-10"&gt;
          @Html.TextBoxFor(model =&gt; model.Reason, new { htmlAttributes = new { @class = "form-control" } })
          @Html.ValidationMessageFor(model =&gt; model.reason, "", new { @class = "text-danger" })
      &lt;div class="form-group"&gt;
          &lt;div class="col-md-offset-2 col-md-10"&gt;
              &lt;input type="submit" value="submit" class="btn btn-default" /&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      etc ....... 
  </code></pre>
  
  <p>kindly if somebody knows let me know</p>