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));
    }
Пример #2
0
 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));
    }
Пример #4
0
 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.
 }
Пример #5
0
 public ActionResult YourAction(YourViewModel viewModel)
 {
     var resultFromInsert = viewModel.InserRecord();
     // redirect here based on string returned above, or whatever.
 }
Пример #6
0
    public ActionResult YourAction()
    {
        var viewModel = new YourViewModel();

        return(View(viewModel));
    }
Пример #7
0
 View()
 {
     InitializeComponent();
     DataContext = new YourViewModel(this);
 }
 public YourPage()
 {
     InitializeComponent();
     BindingContext = new YourViewModel();
 }
Пример #9
0
 public ActionResult IndexValid9()
 {
     YourViewModel yourViewModel = new YourViewModel();
     return View(yourViewModel);
 }
Пример #10
0
 public ActionResult IndexValid9(YourViewModel yourViewModel)
 {
    //you can put your breakpoint here to see user selected values
    return View(yourViewModel);
 }