title: How to declare pagination pagesize in web.config or to my view
body: <p>I have implemented paging using PageList.MVC. Now I need to that i can change the pagesize from my web.config. Any idea ....</p>
  
  <p>Here is my controller: 
                 public ActionResult UsersWhoHaveConsumedFreeCredit(int Id = 1)
          {</p>
  
  <pre><code>        var result = Manager.GetUsersWhoHaveConsumedFreeCredit();
          JavaScriptSerializer serializer = new JavaScriptSerializer();
          var model = serializer.Deserialize&lt;List&lt;CallHistory&gt;&gt;(result);
          int pageSize = 100;
          //int pageNumber = (page ?? 1);
  
  
          return View(model.ToPagedList(Id, pageSize));
      }
  </code></pre>
  
  <p>And this is my view</p>
  
  <pre><code>           @model PagedList.IPagedList&lt;MyYello.Admin.Models.CallHistory&gt;
  
     @{
        ViewBag.Title = "UsersWhoHaveConsumedFreeCredit";
       Layout = "~/Views/Shared/_Layout.cshtml";
      }
  
      &lt;h2&gt;Users Who Have Consumed Free Credit&lt;/h2&gt;
       @*&lt;table class="table table-striped table-bordered tablesorter" style="display: block"&gt;
    &lt;thead&gt;
  
      &lt;tr&gt;
          &lt;th&gt;Login&lt;/th&gt;
          &lt;th&gt;FirstName&lt;/th&gt;
          &lt;th&gt;LastName&lt;/th&gt;
          &lt;th&gt;Email&lt;/th&gt;
          &lt;th&gt;Country&lt;/th&gt;
          &lt;th&gt;TarrifDesc&lt;/th&gt;
          &lt;th&gt;CalledNum&lt;/th&gt;
          &lt;th&gt;CallStart&lt;/th&gt;
          &lt;th&gt;CallEnd&lt;/th&gt;
    &lt;/tr&gt;
      &lt;/thead&gt;*@
      @foreach (var group in Model.GroupBy(dialed =&gt; dialed.Login))
      {
          var item = group.First();
      {
          &lt;table&gt;
              &lt;tbody&gt;
                  &lt;th class="custom-padding"&gt;Login Id&lt;/th&gt;
                  &lt;th class="custom-padding"&gt;Phone&lt;/th&gt;
                  &lt;th class="custom-padding"&gt;First Name&lt;/th&gt;
                  &lt;th class="custom-padding"&gt;Last Name&lt;/th&gt;
                  &lt;th class="custom-padding"&gt;Email&lt;/th&gt;
                  &lt;th class="custom-padding"&gt;Country&lt;/th&gt;
          &lt;tr&gt;
  
              &lt;td class="custom-padding"&gt;@item.Login &lt;/td&gt;
              &lt;td class="custom-padding"&gt;@item.Phone&lt;/td&gt;
              &lt;td class="custom-padding"&gt;@item.FirstName&lt;/td&gt;
              &lt;td class="custom-padding"&gt;@item.LastName&lt;/td&gt;                
              &lt;td class="custom-padding"&gt;@item.Email&lt;/td&gt;
              &lt;td class="custom-padding"&gt;@item.Country&lt;/td&gt;
              &lt;th class="custom-padding"&gt;Dialed Calls:-&lt;/th&gt;
              &lt;td class="custom-padding"&gt;@string.Join(" - ", group.Select(dialed =&gt; dialed.DialedNumber))&lt;/td&gt; &lt;/tr&gt;
              @*&lt;td&gt;@item.FirstName&lt;/td&gt;
              &lt;td&gt;@item.LastName&lt;/td&gt;
              &lt;td&gt;@item.Email&lt;/td&gt;
              &lt;td&gt;@item.Country&lt;/td&gt;*@
  
              @*&lt;td&gt;@string.Join(" - ", group.Select(history =&gt; history.Phone))&lt;/td&gt;*@
             &lt;tr&gt; @*&lt;td&gt;@item.TariffDescription&lt;/td&gt;*@    
          &lt;/tr&gt;
             &lt;/tbody&gt;
          &lt;/table&gt;  
          &lt;hr /&gt; 
      }
      }
  
  
           @* @Html.PagedListPager( (IPagedList)ViewBag.pageNumber, page =&gt; Url.Action ("UsersWhoHaveConsumedFreeCredit", new {page}));*@
         &lt;div class="paged-list"&gt;
        @Html.PagedListPager(Model, Id =&gt; Url.Action("UsersWhoHaveConsumedFreeCredit", new { Id        }), PagedListRenderOptions.Classic)
  &lt;/div&gt;
  
  
          @if (!Model.Any())
              {
  
                     &lt;h2&gt;No Record Found&lt;/h2&gt; 
  
              }
  </code></pre>