This question is locked. New answers and comments are not allowed.
Hi,
I have a grid that works fine with HTML.ActionLink ....
But when I try to use AJAX.ActionLink, I get the error "
this is the error ....
I tried to find some examples of this, but the ones I found working with Telerik MVC Grids did not seem to work. I know I am not seeing something ?
thanks for your time.
I have a grid that works fine with HTML.ActionLink ....
| <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<BCAnalytics.Models.CompanyVM>>" %> |
| <%if (false) |
| {%> |
| <script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script> |
| <% }%> |
| <p><%= Html.ActionLink((String)Resources.BCAResources.stdClose, "Index", "Work", new { workindex = 0 }, null)%></p> |
| <%= Html.Telerik().Grid(Model) |
| .Name("CompanyGrid") |
| .Columns(columns => |
| { |
| // columns.Add(o => o.cMemberNo).Width(30); |
| // columns.Add(o => o.cCompanyNo).Width(30); |
| columns.Add(o => o.cCompanyName).Width(175).Title((string)Resources.BCAResources.coxCompany) |
| .HtmlAttributes(ID="cname"); |
| columns.Add(o => o.cPhone).Title((string)Resources.BCAResources.stdPhone).Width(75); |
| columns.Add(o => o.cGroupCode).Title((string)Resources.BCAResources.coxGroupCode).Width(100); |
| columns.Add(o => o.cEmail).Width(120).Title((string)Resources.BCAResources.stdEmail).Width(150); |
| columns.Add(o => o.cDateUpdated).Format("{0:MM/dd/yyyy}").Width(85).Title((string)Resources.BCAResources.stdUpdated); |
| columns.Add(o => o.cCompanyNo).Format(Html.ActionLink((String)Resources.BCAResources.stdEdit, "Index", "Work", new { workindex = 2, OtherParms = "{0}" }, null).ToString()).Encoded(false).Title("").Width(32); |
| columns.Add(o => o.cCompanyNo).Format(Html.ActionLink((String)Resources.BCAResources.stdDelete, "CompanyDelete", new { Id = "{0}" }, null).ToString()).Encoded(false).Title("").Width(50); |
| }) |
| .Ajax(settings => settings.Action("_AjaxBindingCompany", "Company")) |
| .Pageable() |
| .Sortable(sort => sort.SortMode(GridSortMode.MultipleColumn)) |
| .Scrollable(scrolling => scrolling.Height(200)) |
| .Filterable() |
| %> |
| <p><%= Html.ActionLink((String)Resources.BCAResources.coxFormEntry, "Index", "Work", new { workindex = 2, OtherParms = "Create" }, null)%></p> |
But when I try to use AJAX.ActionLink, I get the error "
Input string was not in a correct format.
I have tried several variations of this line of code, wont list them all here, but this is the latest one I have tried.
| <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<BCAnalytics.Models.CompanyVM>>" %> |
| <p><%= Html.ActionLink((String)Resources.BCAResources.stdClose, "Index", "Work", new { workindex = 0 }, null)%></p> |
| <div id="CompanyGridr"> |
| <%= Html.Telerik().Grid(Model) |
| .Name("CompanyGrid") |
| .Columns(columns => |
| { |
| columns.Add(o => o.cMemberNo).Width(30) ; |
| columns.Add(o => o.cCompanyNo).Width(30); |
| columns.Add(o => o.cCompanyName).Width(175).Title((string)Resources.BCAResources.coxCompany); |
| columns.Add(o => o.cPhone).Title((string)Resources.BCAResources.stdPhone).Width(75); |
| columns.Add(o => o.cGroupCode).Title((string)Resources.BCAResources.coxGroupCode).Width(100); |
| columns.Add(o => o.cEmail).Width(120).Title((string)Resources.BCAResources.stdEmail).Width(150); |
| columns.Add(o => o.cDateUpdated).Format("{0:MM/dd/yyyy}").Width(85).Title((string)Resources.BCAResources.stdUpdated); |
| columns.Add(o => o.cCompanyNo).Format(Html.ActionLink((String)Resources.BCAResources.stdEdit, "Index", "Work", new { workindex = 3, OtherParms = "{0}" }, null).ToString()).Encoded(false).Title("").Width(32); |
| columns.Add(o => o.cCompanyNo).Format(Ajax.ActionLink("Del", "CompanyDelete", new { Id = "{0}" }.ToString(), new AjaxOptions() { UpdateTargetId = "CompanyGridr" })).Encoded(false).Title("").Width(50); |
| }) |
| .Ajax(settings => settings.Action("_AjaxBindingCompany", "Company")) |
| .Pageable() |
| .Sortable(sort => sort.SortMode(GridSortMode.MultipleColumn)) |
| .Scrollable(scrolling => scrolling.Height(200)) |
| .Filterable() %> |
| </div> |
| <p><%= Html.ActionLink((String)Resources.BCAResources.coxFormEntry, "Index", "Work", new { workindex = 2, OtherParms = "" }, null)%></p> |
this is the error ....
| Server Error in '/' Application. |
| -------------------------------------------------------------------------------- |
| Input string was not in a correct format. |
| Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. |
| Exception Details: System.FormatException: Input string was not in a correct format. |
| Source Error: |
I tried to find some examples of this, but the ones I found working with Telerik MVC Grids did not seem to work. I know I am not seeing something ?
thanks for your time.