Skip to content

Save code at Razor level not only at C# code level #2

Open
@weiminye

Description

@weiminye

If can write below code to instead of JavaScript at Razor should save a lots code

@(Html.Grid("basic")
.SetCaption("Basic Grid")
.AddColumn(new Column("Id")
.SetLabel("Id"))
.AddColumn(new Column("FirstName"))
.AddColumn(new Column("LastName"))
.AddColumn(new Column("City"))
.AddColumn(new Column("Zip"))
.SetUrl("/Home/IndexJsonList/")
.SetAutoWidth(true)
.SetRowNum(10)
.SetRowList(new int[]{10,15,20,50})
.SetViewRecords(true)
.SetPager("pager"))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions