Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am developing a search page using MVC4 and Bootstrap
The top line includes the search criteria
The second line displays Page x of x
The rest of the page includes the list of data
When the page fist renders the formatting is correct, however when I click any of the paging buttons/icons, the second line renders between the table header and table data.
Below is my code
Controller Code - sending to View
The view works and the Partial does not
C#
if (Request.IsAjaxRequest())
 {
     return PartialView("_CashFlowList", _acctCashFlow);
 }
 return View(_acctCashFlow);



Ajax.BeginForm
HTML
@using (Ajax.BeginForm("Index", "AcctCashFlow", new AjaxOptions()
{
    InsertionMode = InsertionMode.Replace,
    UpdateTargetId = "cashFlowList",
}))
{
  <div class="container" style="padding-left: 50px">
      <div class="row" style="background-color: lightgray">
            <div class="col-md-7 col-sm-offset-1">
                 Filter
                <select id="rangeFilter" name="rangeFilter">
                    <option value="YTD">Year to Date</option>
                    <option value="R12">Rolling 12 months</option>
                </select>
               Go To
                <select id="cashCategory" name="cashCategory">
                    @foreach (var item in @Model._lstCFT)
                    {
                        <option value="@item.Id">@item.Description</option>
                    }
                </select>
                <input  type="submit" value="Search" />
                <input type="text" id="idPage" name="pageNumber" style="display:none" />
                <input type="text" id="idMaxPage" name="totalPages" style="display:none" />
                <input type="text" id="idAction" name="pageAction" style="display:none" />
                <button class="btn-sm" id="idFirst"></button> 
                <button class="btn-sm" id="idPrev"></button> 
                <button class="btn-sm" id="idNext"></button> 
                <button class="btn-sm" id="idLast"></button> 
            </div>
     </div>
      @Html.Partial("_cashFlowList", @Model)
  </div>


The Partial View
The Page Line
HTML
<div class="row" style="background-color: lightgray">
                <div class="col-md-4 col-sm-offset-8">
                     Page <label id="idCurrPage" style="width:10px">@Model.CurrentPage  </label> of <label id="idTotPage">@Model.TotPages</label>
                </div>
            </div>

The Data
Table Header
HTML
<div class="row">
       <div class="col-md-11 col-sm-offset-1" style="padding-left: 35px">
           Table Data<pre lang="HTML">

@foreach (var item in @Model._cashFlowlist)
{

@if (item.Description == null)
{

What I have tried:

Google, MSDN, rearranging the Partial View












Date Symbol
@Html.DisplayFor(modelItem => @item.TradeDate)
Posted
Updated 13-Oct-16 11:56am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900