public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { var name = values[0] as String; var vm = values[1] as YourViewModel; return(YourViewModel.HasClaim(name)); }
public ActionResult Post(YourViewModel Submitted) { //Handle submitted data here foreach (var QuestionID in Submitted.QuestionIDs) { //Do something } }
public ActionResult YourAction() { YourViewModel viewModel = new YourViewModel { Statuses = statusRepository.FindAll() }; return(View(viewModel)); }
public ActionResult Index(YourViewModel model) { #region backend validation if ( !GoogleReCAPTCHAHelper.Check(Request["g-recaptcha-response"], ConfigurationManager.AppSettings["GoogleReCAPTCHASecret"])) { ModelState.AddModelError(string.Empty, "You have to confirm that you are not robot!"); return(View(model)); } // do your validation #endregion // do your needs here. }
public ActionResult YourAction(YourViewModel viewModel) { var resultFromInsert = viewModel.InserRecord(); // redirect here based on string returned above, or whatever. }
public ActionResult YourAction() { var viewModel = new YourViewModel(); return(View(viewModel)); }
View() { InitializeComponent(); DataContext = new YourViewModel(this); }
public YourPage() { InitializeComponent(); BindingContext = new YourViewModel(); }
public ActionResult IndexValid9() { YourViewModel yourViewModel = new YourViewModel(); return View(yourViewModel); }
public ActionResult IndexValid9(YourViewModel yourViewModel) { //you can put your breakpoint here to see user selected values return View(yourViewModel); }