Am new to MVC so please bear with me.
What I'm trying to do is, on page 1 , user enters values into two text fields and on clicking submit button, it will call wcf service and if wcf call returns validated values then it should redirect to different page and display the returned values from wcf call.
I created view like this -
<input type="text" name="txtUniqueCode" value="@Model.UniqueCode" placeholder="unique identifier" />
<label for="name">
Vehicle Registration
</label>
<input type="text" name="txtRegistration" value="@Model.Registration" placeholder="Registration" />
<a href="@Url.Action("ShowRepairDetails", "RepairDetails", new { uniqueCode = Model.UniqueCode, registration = Model.Registration })">Check Status</a>
After user enters values in the textbox's and as soon as he clicks "Check status", am trying to pass the values to the controller using Url.Action. But when I debug and check the parameter values on controller they are coming back to me as null. Am not sure why ??
I tried replacing the parameter values with static values like below in url.Action -
@Url.Action("ShowRepairDetails", "RepairDetails", new { uniqueCode = 1234, registration = "Test" })
that was working fine, I was receiving the parameter values correctly on controller side. So from what I understood "Model" object is not getting updated even after user enters some values into text box. I'm missing something here. Could you please help..
Thanks in advance
Sai