maqskywalker
asked on
asp.net webgrid helper C# razor syntax
Hi experts,
I have asp.net mvc application, using VB and razor syntax.
My application works just fine.
Now i'm trying to convert this app into asp.net mvc application, using C# and razor.
I have a partial view in my VB application that looks like this. It works just fine.
Visual Basic webgrid
I'm trying to translate this snippet into C# but I'm having trouble. The specific line i'm having trouble with is the first grid.column which looks like this:
grid.Column("EmployeeID", "EmployeeID", format:=Function(str) Html.ActionLink(CType(str, System.Web.Helpers.WebGrid Row).Value .employeeI D, "Edit", "Form" & CType(str, System.Web.Helpers.WebGrid Row).Value .EmployeeT ype, New With {.RegionNo = CType(str, System.Web.Helpers.WebGrid Row).Value .DistrictN o, .RefNo = CType(str, System.Web.Helpers.WebGrid Row).Value .EmployeeI D}, New With {.class = "ActionLink"})), _
Anyone know how I write this line in C# ?
I have asp.net mvc application, using VB and razor syntax.
My application works just fine.
Now i'm trying to convert this app into asp.net mvc application, using C# and razor.
I have a partial view in my VB application that looks like this. It works just fine.
Visual Basic webgrid
<div id="grid">
@grid.GetHtml(tableStyle:="table-condensed", _
headerStyle:="webgrid-header", _
footerStyle:="webgrid-footer", _
columns:=grid.Columns( _
grid.Column("EmployeeID", "EmployeeID", format:=Function(str) Html.ActionLink(CType(str, System.Web.Helpers.WebGridRow).Value.employeeID, "Edit", "Form" & CType(str, System.Web.Helpers.WebGridRow).Value.EmployeeType, New With {.RegionNo = CType(str, System.Web.Helpers.WebGridRow).Value.DistrictNo, .RefNo = CType(str, System.Web.Helpers.WebGridRow).Value.EmployeeID}, New With {.class = "ActionLink"})), _
grid.Column("FirstName", "First Name"), _
grid.Column("LastName", "Last Name")
)
)
</div>
I'm trying to translate this snippet into C# but I'm having trouble. The specific line i'm having trouble with is the first grid.column which looks like this:
grid.Column("EmployeeID", "EmployeeID", format:=Function(str) Html.ActionLink(CType(str,
Anyone know how I write this line in C# ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.