Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In the code given below, how do I call SandyInserts with values in createordermodel ?

CSHTML code.

    @foreach (var type in types.OrderBy(t => t.Type == SureFit.ProductType.Shoe ? 1 : 2))
    {
    if (type.ProductCategoryId == 5)
    {
  • @Html.ActionLink("No Shoes", "SandyInserts", "Orders", new { }) LOOKING FOR CORRECT CODE
  • }
    else
    {
  • @type.Name
  • }
    }



ORDERSCONTROLLER: CORRECTION NEEDED HERE AS WELL
[SureFitAuth(Privilege.OrdersCreate)]
public ActionResult SandyInserts(Models.CreateOrderModel model)
{
return this.View(model);
}

What I have tried:

This is my first MVC application.
When I create order, first I have Patient Info screen, then Product Screen, then Product detail screen, Accessories screen called Inserts and finally review order screen,
In product screen I have the option to choose No product which takes me to accessories screen, skipping product detail screen.
When I call ActionResult I should pass the Order model and be able to pass Patient Info but product should be empty.
What is the correct code?
Posted
Updated 27-Nov-17 13:40pm

1 solution

The debugger on the server side with breakpoints and the debug local screen is a good place to start. Do you know how to do that? If not, watch this video: Basic Debugging with Visual Studio 2010 - YouTube[^]

And this is a hand razor pocket reference to have: C# Razor Syntax Quick Reference | You’ve Been Haacked[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900