webgrid中的重载错误 [英] Overload error in webgrid

查看:63
本文介绍了webgrid中的重载错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


收到此错误:



最好的重载方法匹配'System.Web.Helpers.WebGrid.WebGrid(System.Collections.Generic.IEnumerable< object> ;,System.Collections.Generic.IEnumerable< string> ;, string,int,bool,bool,string,string ,字符串,字符串,字符串,字符串,字符串)'有一些无效的参数



i我正在尝试这段代码



getting this error:

The best overloaded method match for 'System.Web.Helpers.WebGrid.WebGrid(System.Collections.Generic.IEnumerable<object>, System.Collections.Generic.IEnumerable<string>, string, int, bool, bool, string, string, string, string, string, string, string)' has some invalid arguments

i am trying this code

public ActionResult Generated_PaySlip(int? emplID, String month) 
        {
            var PaySlip = DataContext.GetMonthlyReport(emplID, month).SingleOrDefault();
            return View(PaySlip);
        }



查看:




VIEW:

@using EmployeeAttendance_app.Models

<h2>Employee Pay Slip</h2>

@{

     var grid = new WebGrid(ViewData.Model, rowsPerPage: 20);

 }

 @grid.GetHtml();

推荐答案

这是构造函数: http:// msdn。 microsoft.com/en-us/library/system.web.helpers.webgrid.webgrid%28v=vs.111%29.aspx [ ^ ]



您需要传递所有值。
Here's the constructor: http://msdn.microsoft.com/en-us/library/system.web.helpers.webgrid.webgrid%28v=vs.111%29.aspx[^]

You need to pass in all values.


这篇关于webgrid中的重载错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆