title: Bind please select on top of dropdown list using jquery ajax
body: <p>Bu using jquery Ajax post method I am calling my action method , fetching records from the data base and displaying them in a dropdown list. Everything is working fine. But I want to show "Please select" as the first option in the dropdown list. I tried everything but nothing is working in my favor. Any help would be very much appreciated. Below is my code :</p>
  
  <p>.cshtml :</p>
  
  <pre><code>&lt;select id="ddlChannelGroupType" name="ddlChannelGroupType"&gt;
  
      &lt;/select&gt;
  </code></pre>
  
  <p>jquery ajax call to fetch the records from database :</p>
  
  <pre><code>   $(document).ready(function () {
  
          var funcareakey = @ViewBag.UserFuncAreaKey
  
          $.ajax(
                         {
                             type: "POST",
                             url: "/MappingChannelGroup/GetCHGRPTYPE/",
                             data: {
                                 userFunctionalAreaKey: funcareakey
                             },
                             success: function (data) {
  
                                 var items = "";
  
                                 $.each(data, function (i, item) {
  
                                     items += "&lt;option value='" + item.channelgrptypekey + "'&gt;" + (item.channelgrptype) + "&lt;/option&gt;";
  
                                 });
  
                                 $("#ddlChannelGroupType").html(items);
  
                             }
  
                         });
  
      });
  </code></pre>
  
  <p>My Action method on the Controller :</p>
  
  <pre><code>public JsonResult GetCHGRPTYPE(int userFunctionalAreaKey)
      {
          List&lt;ChannelGrpTypeVM&gt; objCHGRPMST = MappingChannelToGroupRepository.GetChannelGrpTypeByFuncArea(userFunctionalAreaKey);
          return Json(objCHGRPMST);
      }
  </code></pre>
  
  <p>My Logic on the repository :</p>
  
  <pre><code>public static List&lt;ChannelGrpTypeVM&gt; GetChannelGrpTypeByFuncArea(decimal funcareakey)
      {
          BarcDataContext bc = new BarcDataContext();
  
          var query =
                          (from CHM in bc.XREF_CH_GRP_MST
                           join CGT in bc.REF_CH_GRP_TYPE on CHM.CH_GRP_TYPE_KEY equals CGT.CH_GRP_TYPE_KEY
                           where CHM.SRC_FUNC_KEY == funcareakey
                           select new ChannelGrpTypeVM
                           {
                               channelgrptype = CGT.CH_GRP,
                               channelgrptypekey = CGT.CH_GRP_TYPE_KEY
  
                           }).Distinct().OrderBy(m =&gt; m.channelgrptype).ToList();
  
          return query;
      } 
  </code></pre>