Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
C#
context.MapRoute(
               "ImportNightflight_default",
               "ImportNightflight/{controller}/{action}/{id}",
               new { action = "Index", id = UrlParameter.Optional }
           );



@Html.ActionLink("Nightflight - Imported files history", "List", new { controller = "ImportedDocs", area = "ImportNightflight" })

this returnd onlu href.
example :Nightflight - Upload and import rows

give me the solutions as soon as possible
Posted
Comments
Rajib Mahata 25-Mar-14 3:46am    
this return only href.
example :
'Nightflight - Upload and import rows'
Anubhav689 25-Mar-14 6:48am    
Why are you posting same question again and again!!!

1 solution

You need to add namespaces if your controller and areas name is same.

For more help visti:
Areas in ASP.NET MVC 4[^]
 
Share this answer
 
Comments
Rajib Mahata 25-Mar-14 11:31am    
context.MapRoute(
"ImportNightflight_default",
"ImportNightflight/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional }
,namespaces: new[] { "ArleATPImportWebApp.Areas.ImportNightflight.Controllers" }
);

but output is same onlt href return
Snesh Prajapati 25-Mar-14 13:48pm    
You need to modify code of your action link as given below:
@Html.ActionLink("DisplayText", "ActionName", "ControllerName", new { area="AreaName"}, null)

For example in my article i put following action in layout page as given below:

@Html.ActionLink("Men", "Index", "Clothing",new { area="Men"},null)
Rajib Mahata 26-Mar-14 1:03am    
I show your project .I implement on a demo project it's worked but in my main project it does not work .what will be the problem can you tell me ?
Snesh Prajapati 26-Mar-14 1:12am    
In you case ...it should be something like:
@Html.ActionLink("Nightflight - Imported files history", "Index", "ImportedDocs", new { area="ImportNightflight"}, null)

If I understand correctly...
The Text you want is : Nightflight - Imported files history
Area Name: ImportNightflight
Controller Name: ImportedDocs
Action Name : Index
.....Otherwise you need to change accordingly.

One more thing....Are you able to access webpages inside area by directly writing URL in Browser (without clicking on Action link) ?

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