I'm doing a small exercise of operations consuming a Web Service, but I can not find a way to show the result in the view, I'm not using Model.
Controller
public ActionResult Index()
{
return View();
}
[HttpPost]
public ActionResult Index(int primero, int segundo)
{
// Creación de un objeto de referencia del servicio web
ServiceReference1.CalculatorSoapClient multi = new ServiceReference1.CalculatorSoapClient();
// llama y almacena el resultado del servicio web en la variable
var multiplicac = multi.Multiply(primero, segundo);
return View();
}
View
@Html.Label("PRIMER NUMERO");
@Html.Editor("primero")
@Html.Label("SEGUNDO NUMERO");
@Html.Editor("segundo")
@Html.Label("la respuesta es : " );
<input type="submit" name="Calcular" value="Calcualar" />
When I do the operation in the controller if it shows me the result, correctly. How can I do in the view to show me the result, or is there another way to do an operation?