Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
weiminye opened this issue Dec 21, 2014 · 0 comments
Open

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

weiminye opened this issue Dec 21, 2014 · 0 comments

Comments

@weiminye
Copy link
Owner

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"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant