Search code examples
asp.net-mvctwitter-bootstraprazormvccontrib

"There is no data available." Where is it from?


I have the code below and I want to display the data in the table.

<div class="widget wblue no-margin-top">
  <div class="widget-head">
    <div class="pull-left">Country Languages</div>
    <div class="pull-right"><a href="#addLanguageModal" class="btn btn-navbar btn-gray" data-toggle="modal" role="button">Add New Language</a></div>
  </div>
  <div class="widget-content">
    @using (Html.BeginForm("Language", "Country", FormMethod.Post, new { enctype = "multipart/form-data" }))
    {
      @Html.HiddenFor(m => m.CountryId)
      @Html.Grid(Model.Languages).Columns(column =>
      {
        column.For(m => m.LanguageName).Named("Languages");
        column.For(m => String.Format("<a class='btn btn-primary' href='/Country/LanguageEdit/{0}'>Edit</a> <a href='#deleteConfirmModal' role='button' data-toggle='modal' class='btn btn-danger deleteBtn'><input type='hidden' id='CountryId' value='{0}'/>Remove</a>", m.CountryId)).Named("Actions").Encode(false);
      }).Attributes(@class => "table")
   }
  </div>
</div>

Unfortunately for this CountryId there is no language in the database. I saw it displayed the sentence

There is no data available.

I don't have this sentence There is no data available. in my code. My question is where is it from? How it was generated? From Bootstrap or Razor engine?


Solution

  • The message is from your @Html.Grid. Like other helpers, this HTML helper will render an html grid component on the page which may or may not use javascript files along with it.

    You can actually customize the message for empty data by doing the following: Overriding the default 'No Data' Message in MVCContrib Grid