views:

119

answers:

1

A website's default page is setup as follows:

http://mysite.com/myapp/ ==> http://mysite.com/myapp/views/default.aspx

As you can see the only thing a little out of the ordinary is that the default page is in a subdirectory (views)

If I access the page via the default URL (http://mysite.com/myapp/) the form tag looks like this

<form name="aspnetForm" method="post" action="default.aspx" id="aspnetForm">

The problem is that the page posts back to http://mysite.com/myapp/default.aspx (missing the "/views/" part of the path) which is a non-existent page, so I get a Page Not Found (404) error.

Has anyone else experienced this? What is the workaround?

+1  A: 

You have to change the action link to go to the right location:

<form name="aspnetForm" method="post" action="~/views/default.aspx" id="aspnetForm">
ryanulit
You led me down the right path. Although I don't have access to the <form> tag in the ASPX markup for the page (it's on the master page). I was able to set the action in the code behind which solved the issue (`Page.Form.Action="~/views/default.aspx"`)
WayneC