Try our conversational search powered by Generative AI!

@Url.Action not working???

Vote:
 

Hi Guys,

   I want to navigate to another controller when user click on button, so i using @Url.Action but its not working properly, below you can see my code.

  

#180434
Jul 10, 2017 14:12
Vote:
 

Hi,

If you just render @Url.Action("Index", "PatientDetails"), what do you end up with then? Also, you shouldn't use a button for navigation, you must use a regular link (a/anchor tag).

If you want to generate a link to public ActionResult Index(PatientDetails currentPage) you should do like this: @Url.Action("Index", new { node = Model.ContentLink }). Episerver is using 'node' internally to route to an action with PageData.

#180437
Jul 10, 2017 15:57
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.