Skip to content
Loading
 
+1
  • Sachin Singh
    +1
    it doesn't matter you want apple or not, inplace of apple what do you want to eat?
    if you don't want to redirect to home controller then on which controller do you want to redirect the request?
     
    for example if you change the routeName to something else it will be redirected to that.
    1. "@Url.RouteUrl("eNtsaPaymentOrders")">SuperAdmin
    2.    
     Now it will be redirected to controller = "eNtsaAddToCard", action = "eNtsaPaymentOrders"
    +1
  • +1
    Hi Sachin
     
    System.ArgumentException: 'A route named 'eNtsaAddToCard' could not be found in the route collection.
    Parameter name: name'
     
    You see what i am trying to raise here, i have 'HomeController' and my dashboard is on HomeController routing. How do i access routing of another controller? I have 'eNtsaAddToCard'  as a controller. See here
    1. // Rooute to AddtoCart.  
    2.          routes.MapRoute(  
    3.              name: "eNtsaPaymentOrders/",  
    4.              url:"add-to-card",  
    5.              defaults:new {controller = "eNtsaAddToCard", action = "eNtsaPaymentOrders", id = UrlParameter.Optional }  
    6.           );  
     
  • "@Url.RouteUrl("eNtsaPaymentOrders")">SuperAdmin
  • // This is causing the above exception.
    +1
  • +1
    Hi Sachin and All team
     
    I was suppose to do this casting, first call the ActionResult name and its controller name like this below
    1.   
    2.               class="link">class="fas fa-shopping-cart">Checkoutclass="fa fa-chevron-down">
      
  •               class="submenu">  
  •                   
  • "@Url.Action("DisplayProducts", "eNtsaCourseDetails")">Add to Cart
  •   
  •                 
  •  
    +1