0

In my Asp.net MVC 5 (C#) project I want to create some links by @Html.ActionLink or every you know is better like:

/Tags/Linq

/Tags/SqlServer

/Tags/MVC

That Tags is constant name and after that in the URL is tag name.For example like ScottGu's Blog

In addition I want to pass a parameter such as Id but I don't want to show in the URL.

How can I do it?

And how should I write a suitable MapRoute for it?

Please help me.

x19
  • 8,277
  • 15
  • 68
  • 126

1 Answers1

0

For example (don't forget to write it before default route):

routes.MapRoute(
     "Tags",
     "tags/{tagTerm}",
     new { controller = "Tags", action = "SearchTagResults" }
);

In addition (passing Id) use POST not GET.

Sergey Shabanov
  • 176
  • 2
  • 11