I have a very simple page , which displays Log4Net entries on the page. It has a grid with a refresh button.
When I hit the refresh button, I do supply additional parameter to the refresh function.
It works in 2013.3.1119 and before, but that functionality is broken in 2013.3.1316.340.
The Page:
Controller Action:
Javascript function:
Javascript correctly returns the fileName parameter, but the controller's fileName parameter is now always null.
And as I said it works in 2013.3.1119 .
Looking into the raw HTML request I'm no longer see fileName as a part of the Form data.
When I hit the refresh button, I do supply additional parameter to the refresh function.
It works in 2013.3.1119 and before, but that functionality is broken in 2013.3.1316.340.
The Page:
@using Monitoring.Contracts.Models
@model Tuple<IEnumerable<string>, IEnumerable<Log4NetLogItem>>
@{
var items = Model.Item1.Select(m => new SelectListItem {Text = m, Value = m});
}
<div style="width: 100%;text-align: center">
<div style="display: inline-block">
Log4NET Log Viewer
@(Html.Kendo().DropDownList()
.Name("ddLogFiles")
.DataTextField("Text")
.DataValueField("Value")
.Events(e => e.Change("adminContext.ddLogFilesChange"))
.BindTo(items)
.SelectedIndex(0)
)
</div>
<br/><br/>
<div style="text-align: left">
@(Html.Kendo().Grid(Model.Item2).Name("grdLogItems")
.Columns(c =>
{
c.Bound(a => a.LogDate).ClientTemplate("#= kendo.toString(LogDate, \"yyyy-MM-dd HH:mm:ss\") #").Width("10%");
c.Bound(a => a.LogLevel).Width("5%");
c.Bound(a => a.UserName).Width("10%");
c.Bound(a => a.UserAddress).Width("10%");
c.Bound(a => a.LoggingClass).Width("10%");
c.Bound(a => a.LogMessage).Width("45%");
c.Bound(a => a.UserAgent).Width("20%");
}
)
.Pageable(p=>p.PageSizes(new[]{5,20,100}).Refresh(true))
.Sortable()
.Filterable()
.Scrollable(a=>a.Height(500))
.Resizable(a=>a.Columns(true))
.DataSource(d=>d.Ajax().PageSize(100).ServerOperation(false).Read(r=>r.Action("GetLogEntries","Admin").Data("adminContext.extraLogData")))
)
</div>
</div>
@model Tuple<IEnumerable<string>, IEnumerable<Log4NetLogItem>>
@{
var items = Model.Item1.Select(m => new SelectListItem {Text = m, Value = m});
}
<div style="width: 100%;text-align: center">
<div style="display: inline-block">
Log4NET Log Viewer
@(Html.Kendo().DropDownList()
.Name("ddLogFiles")
.DataTextField("Text")
.DataValueField("Value")
.Events(e => e.Change("adminContext.ddLogFilesChange"))
.BindTo(items)
.SelectedIndex(0)
)
</div>
<br/><br/>
<div style="text-align: left">
@(Html.Kendo().Grid(Model.Item2).Name("grdLogItems")
.Columns(c =>
{
c.Bound(a => a.LogDate).ClientTemplate("#= kendo.toString(LogDate, \"yyyy-MM-dd HH:mm:ss\") #").Width("10%");
c.Bound(a => a.LogLevel).Width("5%");
c.Bound(a => a.UserName).Width("10%");
c.Bound(a => a.UserAddress).Width("10%");
c.Bound(a => a.LoggingClass).Width("10%");
c.Bound(a => a.LogMessage).Width("45%");
c.Bound(a => a.UserAgent).Width("20%");
}
)
.Pageable(p=>p.PageSizes(new[]{5,20,100}).Refresh(true))
.Sortable()
.Filterable()
.Scrollable(a=>a.Height(500))
.Resizable(a=>a.Columns(true))
.DataSource(d=>d.Ajax().PageSize(100).ServerOperation(false).Read(r=>r.Action("GetLogEntries","Admin").Data("adminContext.extraLogData")))
)
</div>
</div>
public ActionResult GetLogEntries([DataSourceRequest]DataSourceRequest request, string fileName)
{
string path = Server.MapPath("~\\Logs");
var newpath = string.Format("{0}\\{1}{2}", path, fileName, ".log");
IEnumerable<Log4NetLogItem> lines = ClientNetworkManager.GetLogItems(newpath);
return Json(lines.ToDataSourceResult(request));
}
{
string path = Server.MapPath("~\\Logs");
var newpath = string.Format("{0}\\{1}{2}", path, fileName, ".log");
IEnumerable<Log4NetLogItem> lines = ClientNetworkManager.GetLogItems(newpath);
return Json(lines.ToDataSourceResult(request));
}
Javascript function:
extraLogData: function () {
var dropdownlist = $("#ddLogFiles").data("kendoDropDownList");
return { fileName: dropdownlist.value() };
}
var dropdownlist = $("#ddLogFiles").data("kendoDropDownList");
return { fileName: dropdownlist.value() };
}
Javascript correctly returns the fileName parameter, but the controller's fileName parameter is now always null.
And as I said it works in 2013.3.1119 .
Looking into the raw HTML request I'm no longer see fileName as a part of the Form data.