Search code examples
asp.net-mvc-3model-view-controllerhtml.actionlink

Html.ActionLink port setting


How do you set up a diffrent port in

public static MvcHtmlString ActionLink(
   this HtmlHelper htmlHelper,
   string linkText,
   string actionName,
   string controllerName,
   string protocol,
   string hostName,
   string fragment,
   Object routeValues,
   Object htmlAttributes
  )

I have two web pages (mvc 3) in my solution and as far as I am familiar with you cannot have both on the same address (if I am wrong here please correct me).

If I do place this link in my first web page @Html.ActionLink("WebPage2", "Index", "Controller", "http", "localhost:5928", null, null, null)

I get url like: localhost:5928:5000 where 5000 is port on which my first web page is


Solution

  • If your applications are gonna be routing to each other, and sharing code maybe you should be looking at the use of Areas instead of separate projects