Beispiel #1
0
        public string InvokeNM(HtmlHelper fatherHelper, T model, string prefix)
        {
            ViewDataDictionary <T> dataDictionary = new ViewDataDictionary <T>(model);

            dataDictionary.TemplateInfo.HtmlFieldPrefix = prefix;
            BasicHtmlHelper.CopyRelevantErrors(dataDictionary.ModelState, fatherHelper.ViewData.ModelState, dataDictionary.TemplateInfo.HtmlFieldPrefix);

            return(InvokeNM(fatherHelper, dataDictionary));
        }
Beispiel #2
0
        public string Invoke <M>(HtmlHelper <M> fatherHelper, T model, string prefix, string truePrefix = null)
        {
            ViewDataDictionary <T> dataDictionary = new ViewDataDictionary <T>(model);

            dataDictionary.TemplateInfo.HtmlFieldPrefix = prefix;
            if (truePrefix != null)
            {
                dataDictionary["_TruePrefix_"] = truePrefix;
            }
            BasicHtmlHelper.CopyRelevantErrors(dataDictionary.ModelState, fatherHelper.ViewData.ModelState, dataDictionary.TemplateInfo.HtmlFieldPrefix);

            return(Invoke(fatherHelper, dataDictionary));
        }
Beispiel #3
0
        public HtmlHelper BuildHelper(HtmlHelper fatherHelper, object model, string prefix, bool useContextWriter = false)
        {
            T tModel = default(T);

            if (model != null)
            {
                tModel = (T)model;
            }
            ViewDataDictionary <T> dataDictionary = new ViewDataDictionary <T>(tModel);

            dataDictionary.TemplateInfo.HtmlFieldPrefix = prefix;
            BasicHtmlHelper.CopyRelevantErrors(dataDictionary.ModelState, fatherHelper.ViewData.ModelState, dataDictionary.TemplateInfo.HtmlFieldPrefix);
            return(BuildHelper(fatherHelper, dataDictionary, useContextWriter));
        }