In my main controller, to switch views, I just call another action from my controller, but my model that I pass is null after it is passed and has no null value.
public ActionResult Index(ViewModelViewImages model) { return RedirectToAction("ViewImages", new { passedModel = model }); }
In the same controller ..
public ActionResult ViewImages(ViewModelViewImages passedModel) {
However, I can write out my variables and they go just fine
string pro = model.Prospects; string cnt = model.Countys; string twn = model.TownShips; string rng = model.Ranges; string sct = model.Sections; return RedirectToAction("ViewImages", new { idpro = pro , idcnt = cnt, idtwn = twn, idrng = rng, idsct = sct});
In return, I would get them in another action like this:
public ActionResult ViewImages(string idpro, string idcnt, string idtwn, string idrng, string idsct)
I searched for a couple of hours, just stumbled upon This question , which does not yet have a specific answer.
Is there a good reason for this? / What am I doing wrong?
Don thomas boyle
source share