title: Partial postback of page with dropdownlist using AJAX on MVC3 page EF4
body: <p>I have a dropdownlist which lists Country names
  When user select any country from dropdown list.Based on the  country selection, I need data(AgencyName, AgencyAddr,Pincode) to be loaded from database and fill the TextBoxs on the right side.The selected country in the dropdown should remain selected.</p>
  
  <p>on selection  change of dropdownlist ,I do not want the entire page to postback .Please help me </p>
  
  <p>Here is my EF4 - ModelClasses</p>
  
  <pre><code>public class Country
  {
      public int CountryID { get; set; }
      public string CountryName { get; set; }
  
  }
  
  public class AgencyInfo
  {
      public int CountryID { get; set; }
      public string AgencyName { get; set; }
      public string AgencyAddr { get; set; }
      public int Pincode { get; set; }
  
  }
  </code></pre>
  
  <p>Here is my MVC4 razor page  Index.cshtml</p>
  
  <pre><code>        @using (Ajax.BeginForm(
  "Index",
  "Home",
  new AjaxOptions { UpdateTargetId = "result" }
  ))
  {
  @Html.DropDownList("SelectedCountryId", Model.CountryList, "(Select one event)")
  }
  
  &lt;div id=’result’&gt;
  &lt;fieldset&gt;
      &lt;legend&gt;Country Details: &lt;/legend&gt;
      &lt;div&gt; 
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;span&gt;Country Name &lt;/span&gt;
                      &lt;br /&gt;
                         @Html.EditorFor(model =&gt; model.Countries.Name)
              @Html.ValidationMessageFor(model =&gt; model. Countries.Name)
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;span&gt;Agency Name &lt;/span&gt;
                      &lt;br /&gt;
                      @Html.EditorFor(model =&gt; model.AgencyInfo.AgencyName)
                      @Html.ValidationMessageFor(model =&gt; model.AgencyInfo.AgencyName)
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;span&gt;Address Info &lt;/span&gt;
                      &lt;br /&gt;
                       @Html.EditorFor(model =&gt; model. AgencyInfo.Address)
                      @Html.ValidationMessageFor(model =&gt; model. AgencyInfo.Address)
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;span&gt;Pin Code &lt;/span&gt;
                      &lt;br /&gt;
                        @Html.EditorFor(model =&gt; model. AgencyInfo.PinCode)
                      @Html.ValidationMessageFor(model =&gt; model. AgencyInfo.PinCode)
                  &lt;/td&gt;
              &lt;/tr&gt;
  
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;input type="submit" value="Modify" /&gt;&lt;input type="submit" value="Delete" /&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;input type="submit" value="Save" /&gt;&lt;input type="submit" value="View Resources" /&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/div&gt;
  &lt;/fieldset&gt;
  &lt;/div &gt;  @end of result div@
  </code></pre>
  
  <p>Any suggestions ? Thank you </p>