public ActionResult New() { var vM = new UserFormViewModel { Roles = _userRoleService.GetRoles() }; return(View("UserForm", vM)); }
protected void Page_Load(object sender, EventArgs e) { tc = new WebPageControls.TableControls(contentDT, SIZE_PAGE, AJAX_URL); GetViewBind(tc.GotoPage(1)); if (!IsPostBack) { role.DataSource = UserRoleService.GetRoles(); role.DataTextField = "Name"; role.DataValueField = "Id"; role.DataBind(); } GetPageIndex(); pagingAllPage.InnerHtml = "一共有" + tc.TotalPage.ToString() + "页"; }