コード例 #1
0
ファイル: TabModelBinder.cs プロジェクト: SAVeGH/MAKLAK
        private void TabModelBinder_InitializeModel(ControllerContext controllerContext, ModelBindingContext modelBindingContext, Type modelType, BaseModel generatedModel)
        {
            TabModel model = generatedModel as TabModel;

            HttpRequestBase request = controllerContext.HttpContext.Request;

            string modelSelectedKey = request.Form.Get("SelectedKey");

            model.SelectedKey = modelSelectedKey;
        }
コード例 #2
0
        protected void InitializeSuggestionModel(ControllerContext controllerContext, ModelBindingContext bindingContext, Type modelType, BaseModel generatedModel)
        {
            // method is calling inside BindModel method

            HttpRequestBase request = controllerContext.HttpContext.Request;

            string suggestionKey = request.Form.Get("suggestionKey");
            string inputValue = request.Form[0];// первый элемент с любым именем

            SuggestionModel model = generatedModel as SuggestionModel;

            
            SuggestionModelHelper.InitModel(model, inputValue, suggestionKey);

        }
コード例 #3
0
ファイル: HomeController.cs プロジェクト: SAVeGH/MAKLAK
 public ActionResult IndexPost(BaseModel model)
 {
     return PartialView("IndexMain", model);
 }