This question is locked. New answers and comments are not allowed.
Hi, I am new to Telerik MVC controls and i am using telerik Grid in my Project. I am binding the Grid with Ajax but i am getting error message "Error! The requested URL returned 500-Internal Server Error"... no clue what is meant by this error...
Your help is highly appreciated here.
I am pasting my code here for your review:-
Your help is highly appreciated here.
I am pasting my code here for your review:-
[GridAction] public ActionResult _Search(string _teamId) { InitiateEntities(); var data = GetTeam(_teamId); return View(new GridModel(data)); } public List<IAMPlanTeam> GetTeam(string _teamId) { InitiateEntities(); var query = from p in _amplanEntity.AMPlanTeams select p; if (!string.IsNullOrEmpty(_teamId)) query = query.Where(p => p.ukTeamCode== _teamId); return query.ToList(); }
<% using (Ajax.BeginForm("Search", "AMPlanTeam", new AjaxOptions { HttpMethod = "Post",InsertionMode=InsertionMode.Replace }))
{%>
<%:Html.Label("Team ID:")%> <%:Html.TextBox("teamcode", "")%>
<input id="SearchButton" type="submit" value="Search"/>
<%} %>
$(document).ready(function () { $("#SearchButton").click(function () { var grid = $("#Result").data("tGrid"); var teamid = $('#teamcode').val(); grid.rebind({ _teamId: teamid }); }); });<%Html.Telerik().Grid(Model) .Name("Result") .DataBinding(databinding => databinding.Ajax().Select("_Search", "AMPlanTeam", new { _teamId = "TAD0312120001" })) .Columns(columns => { columns.Bound(o => o.pkTeamId).Title("Primary Key"); columns.Bound(o => o.ukTeamCode).Title("Team ID"); }) .Pageable() .Render(); %>