asp.net mvc - How to call controller method from ActionLink of MVC in Umbraco 7? -


i working on umbraco 7 application. there 1 controller in , trying call method view. when call method actionlink says method not found. when verified url says, wrong. following code snippets:

folling mvc line:

   @html.actionlink("send otp", "index", "registersurface", new { id = "lnksendotp" }) 

following mvc controller method

public actionresult index()     {         return view();     } 

i getting following error on screen, not understand url formation well

enter image description here

it looks you're using wrong overload of actionlink method:

public static mvchtmlstring actionlink(this htmlhelper htmlhelper, string linktext, string actionname, object routevalues, object htmlattributes) {...} 

you want use 1 instead:

public static mvchtmlstring actionlink(this htmlhelper htmlhelper, string linktext, string actionname, string controllername, object routevalues, object htmlattributes) {...} 

try passing additional null argument use correct overload:

@html.actionlink("send otp", "index", "registersurface", null, new { id = "lnksendotp" }) 

Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -