views:

123

answers:

1

Hi, i'm having this issue, in ASP.NET MVC 2 where I'm adding a drop down list on the master page and filling it with data from an abstract master controller. When an option is selected an submit button clicked, it reroutes you to a new page. so lets say

the page lives on http://domain.com/landingPage

  1. i'm on: http://domain.com/landingPage
  2. i select option and submit
  3. takes me to http://domain.com/landingPage/Projects/FramedPage
  4. i select again and now the post tries to go to: http://domain.com/landingPage/Projects/landingPage/Projects/FramedPage because of the action="" i have set on the form tag.

Any ideas on how to go about this?

MasterPage:

<form method="get" action="landingPage/Projects/FramedPage">
 <%= Html.DropDownList("navigationList")%>
 <input id="navSubmitBtn" class="btnBlue" type="submit" value="Take Me There" />
</form>

Projects Controller

public ActionResult FramedPage(string navigationList) { ViewData["navLink"] = navigationList;

return View(); }

The problem i am having is that if I am ON that page

+1  A: 

Use relative location.

<form method="get" action="<%=Url.Action("FramedPage", "ControllerName") %>">
Mendy
<headslap>OF COURSE!!!</headslap>
Tomaszewski