I am trying to obtain data from my html code like the \"acquringCode\", \"cardAcceptor\", and \"merchantId\". I can\'t figure how how to obtain that data in my controller.
//Also note since i have the razor engine you will notice my views are using // @html.TextBoxFor...However if you dont have razor engine... then you would be using // Something like <%Html.TextBoxFor. //
//Controller logic
[HttpPost]
public ActionResult AddSaveTreventLocationLookup(TreventModel model)
{
string acquiringInstitutionIdentificationCode;
string cardAcceptorIdentificationCode;
string merchantId;
acquiringInstitutionIdentificationCode = model.AcquiringInstitutionIdentificationCode;
cardAcceptorIdentificationCode = model.CardAcceptorIdentificationCode;
merchantId = model.MerchantId;
//
return RedirectToAction("TreventLookUp");
}
public ActionResult TreventLookUp()
{
return View("TreventLookUp");
}
}
// View Logic
@model MvcApplication2.Models.TreventModel
//View Model
public class TreventModel
{
public string AcquiringInstitutionIdentificationCode { get; set; }
public string CardAcceptorIdentificationCode { get; set; }
public string MerchantId { get; set; }
}