1

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

Bassam Mehanni
  • 14,796
  • 2
  • 33
  • 41
TheMentor
  • 464
  • 9
  • 25
  • Are these two separate websites? – epignosisx Jan 04 '12 at 21:27
  • You're trying to cross applications with your route links and thats why it won't work. The HtmlHelpers that are present only generate links in relation to your current application. Your sites are seperate applications and are not aware of each other. They have no knowledge of each others route tables or anything. – Nick Bork Jan 04 '12 at 21:54
  • Well I added reference from second site to the first and I have access through intellisense to all controllers and views...its just that because its a seperate mvc 3 page, it reqiures diffrent port – TheMentor Jan 04 '12 at 23:23
  • both pages uses the same db and I will have the same login form. Do you think it would be better to migrate entire second mvc 3 site into the first as area? – TheMentor Jan 04 '12 at 23:25

2 Answers2

1

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

Bassam Mehanni
  • 14,796
  • 2
  • 33
  • 41
0

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.

epignosisx
  • 6,152
  • 2
  • 30
  • 31