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; }
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); }
public ActionResult IndexPost(BaseModel model) { return PartialView("IndexMain", model); }