This is a migrated thread and some comments may be shown as answers.

Grid Action ajax binding issue

0 Answers 45 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
James
Top achievements
Rank 1
James asked on 07 Nov 2012, 05:31 PM
One of my grids on the server just went haywire. I am able to now reproduce it on my client workstation. 

The error is :Error! The Requested URL returned 500 - Internal Server Error
The Fiddler/Firebug details include "The view or its master was not found or no view engine supports the searched locations. The following locations were searched:"

The code posts back to the correct action and the correct object is loaded and returned but then this error occurs. Strange, this code was running fine up until recently. Other grids do not have the same problem and the code is very similar (different objects).

How do i troubleshoot or fix this? I've literally tried everything I can think of. 

Grid: 

@model SAM.Framework.Utilities.CloneClasses.UserIndexBO
@{
  ViewBag.Title = "Index";
  Layout = "~/Views/Shared/_SysLayout.cshtml";
}
@using (Html.BeginForm())
{
  <table style="width: 100%;">
    <tr>
      <td style="width: 50%; text-align: left;">
        <input type="submit" value="Create New" class="btnShadedCSS" />
      </td>
      <td style="width: 50%; text-align: right;">
        <h2>Users</h2>
      </td>
    </tr>
  </table>
  <div class="telerikGrid">
  @(Html.Telerik().Grid<SAM.Framework.Utilities.CloneClasses.MembershipUserTESTBO>(Model.MembershipUserBOs)
    .Name("Grid")
    .DataKeys(keys => keys.Add(c => c.Email))
      .DataBinding(dataBinding => dataBinding.Ajax()
            .Select("GridUsersSelect", "Users")
      )
      .Columns(columns =>
      {
        columns.Bound(c => c.Email).Width(80).Title("Email");
      })
 
      //.Pageable(pager => pager.PageSize(10))
      //.Sortable()
      .Scrollable(scrolling => scrolling.Height(415))
      //.Filterable(filtering => filtering.Enabled(true))
      //.Resizable(resizing => resizing.Columns(true))
      )
    @Html.HiddenFor(model => model.AgencyProfile.Agency)
  </div>
}
 
@section  MyScripts {
    <script src="@Url.Content("~/Scripts/FormRefreshAgencyFromClient.js")" type="text/javascript"></script>
}


Action: (this gets fired and returns).  

public ActionResult GridUsersSelect(string yz)  
      {
        String Agency = ToolsBL.DeObfuscateAgencyNumber(yz);
        try
        {
          List<MembershipUserTESTBO> membershipUserTESTBOs = new List<MembershipUserTESTBO>();
          UserIndexBO userIndexBO = new UserIndexBO();
          userIndexBO.MembershipUserBOs = new List<MembershipUserTESTBO>();
          MembershipUserTESTBO user1 = new MembershipUserTESTBO();
          user1.Email = "111";
          membershipUserTESTBOs.Add(user1);
 
          return View("Index", new GridModel<MembershipUserTESTBO> { Data = membershipUserTESTBOs });
        }
        catch (Exception ex)
        {
          this.HandleException(ex, MethodBase.GetCurrentMethod().Name, SOURCE);
        }
        return View(new GridModel<MembershipUserBO>());
      }

Object: 

public class MembershipUserTESTBO
{
  [Required]
  [Editable(true)]
  public string Email { get; set; }
 
  public MembershipUserTESTBO()
  {
    Email = "jj";
  }
 
}
 
public class UserIndexBO
{
  #region Public Properties
 
  public AgencyProfilesBO AgencyProfile { get; set; }
  public List<MembershipUserTESTBO> MembershipUserBOs { get; set; }
 
  public bool ShowResultOnFirstLoad { get; set; }
  public int RowSelectedPatientID { get; set; }
  #endregion
 
  #region Constructor
 
  public UserIndexBO()
  {
    this.AgencyProfile = new AgencyProfilesBO();
    this.MembershipUserBOs = new List<MembershipUserTESTBO>();
    this.ShowResultOnFirstLoad = false;
    this.RowSelectedPatientID = 0;
  }


Tags
Grid
Asked by
James
Top achievements
Rank 1
Share this question
or