tags:

views:

46

answers:

2

I have uploaded the nerddinner sample to "www.example.com/test/nerd". When a mouse is on menu tab such as "Find a host" then the link is shown at the bottom of Internet explorer as "www.example.com/test/nerd/Dinner" with the contoller name "Dinner". When the mouse is on the main logo which is on top and left, the link shown as "www.example.com". So it direct me to "www.example.com" instead of "www.example.com/test/nerd"

Where can I change it? I have tried to change the "start url" from the application property, but it did not work.

+1  A: 

This application assumes that is installed in the root of the domain, and therefore just contains the path "/". You'll need to edit NerdDinner/Views/Shared/Site.Master. The line you need to touch is

<h1><a href="/" title="Nerd Dinner" class="logo"></a></h1>

Try changing this to

<h1><a href="<%= Url.Action("Index") %>" title="Nerd Dinner" class="logo"></a></h1>

I don't have ASP.NET set up anywhere I can try this, so it probably won't work as is. Hopefully that will at least get you started if it doesn't work perfectly.

Michael Mior
+1  A: 

The NerdDinner application links to the / path when you click on the logo. This points you to the domain root: example.com.

If you want the link to point to your home page instead, there are two ways of doing that:

  1. Have the link point to ~ instead - that's the application root. If you configure the directory you installed NerdDinner in as an IIS application, the controller action with the "" route will handle the request.

  2. Change the <a href="/" to point to your controller action by name: <a href="<%= Url.Action("Index","Home") %>"

Both ways work, but I recommend using the first one, because it will point to whatever action is routed to ""; in other words, if you change the name of your home page action, for example, the link will still work.

Maxim Zaslavsky
Awesome! That was it. <a href="<%= Url.Action("Index","Home") %>". You just saved my 4 hours searching for answer. I really appreciate for the clue. Thanks.
Hoorayo