public async Task Process() { //Create content IHtmlContent res = null; var model = tag.For.Model; bool mode = tag.ModeDefault; if (tag.Mode != null && tag.Mode.Model != null) { mode = (bool)tag.Mode.Model; } RowType rowType; if (model == null) { int rowIndex = tag.ModelNullRowDefault; if (tag.ModelNullRow != null && tag.ModelNullRow.Model != null) { rowIndex = (int)tag.ModelNullRow.Model; } rowType = options.Rows[rowIndex]; } else { rowType = options.GetServerRow(model); } if (mode) { res = await rowType.InvokeEdit(model, basePrefix, helpers); } else { res = await rowType.InvokeDisplay(model, basePrefix, helpers); } //Create Layout options var layoutOptions = new DefaultServerDetailLayoutOptions( helpers, options.Rows, options.Toolbars ?? new List <KeyValuePair <string, string> >(), options.LayoutTemplate, null, res, options.Id, options.FullName, options.CssClass, tag.LocalizationType, mode, tag.FormAction, tag.FormMethod, tag.Antiforgery, tag.NoSubmit ); //Invoke Layout var fres = await options.LayoutTemplate.Invoke(tag.For, layoutOptions, helpers); output.TagName = string.Empty; output.Content.SetHtmlContent(fres); }
public async Task Process() { //Create content IHtmlContent res = null; var model = tag.For.Model; bool mode = tag.ModeDefault; if (tag.Mode != null && tag.Mode.Model != null) mode = (bool)tag.Mode.Model; RowType rowType; if (model == null) { int rowIndex = tag.ModelNullRowDefault; if (tag.ModelNullRow != null && tag.ModelNullRow.Model != null) rowIndex = (int)tag.ModelNullRow.Model; rowType = options.Rows[rowIndex]; } else rowType = options.GetServerRow(model); if (mode) res = await rowType.InvokeEdit(model, basePrefix, helpers); else res = await rowType.InvokeDisplay(model, basePrefix, helpers); //Create Layout options var layoutOptions = new DefaultServerDetailLayoutOptions( helpers, options.Rows, options.Toolbars?? new List<KeyValuePair<string, string>>(), options.LayoutTemplate, null, res, options.Id, options.FullName, options.CssClass, tag.LocalizationType, mode, tag.FormAction, tag.FormMethod, tag.Antiforgery, tag.NoSubmit ); //Invoke Layout var fres = await options.LayoutTemplate.Invoke(tag.For, layoutOptions, helpers); output.TagName = string.Empty; output.Content.SetHtmlContent(fres); }