Learning the ASP MVC now, just my 3rd week on MVC
I did some tests on modeling pass, basically the controller just get the model, and pass into the view without doing anything, but it seems like the code failed.
below is the ViewModel I created
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Bank2.Models.ViewModel
{
public class PaymentView
{
public List<Wires_SWIFT> lists{get; set;}
public string b_str{get; set;}
public string o_str{get; set;}
}
}
This is the View:
@model ViewModel
@using(Html.BeginForm("Payment","Home",FormMethod.Post)){
@Html.TextBoxFor(d=> d.o_str)<br/>
@Html.TextBoxFor(d=> d.b_str)<br/>
<input type="submit" name="Search">
}
The controller grabs the model and pass it through right away
...
[HttpPost]
public ActionResult Payment(ViewModel m){
return View(m)
}
...
I typed two strings in texboxes: like "aa" and "bb", after I clicked the submit, they supposed to be there because the same object being passed back, but the field is empty now
Did I miss something important about modeling passing? Any kind of suggestions are welcomed