Question

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

Était-ce utile?

La 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

Autres conseils

I don't think ActionLink will work for you. ActionLink generates links based on your routes table. Since you are trying to generate links for a separate website (different port) it does not know how to create the link.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top