Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tilde (~) virtual root url results in 404

0 views
Skip to first unread message

davidkclark

unread,
Mar 3, 2009, 5:33:56 PM3/3/09
to
Morning,

I have an ASP.NET website that has been running fine for some months.
It is a very simple single page form that submits back to itself. The
action for the form happens to use the virtual root token: action="~/
direct.aspx"

Yesterday the server was rebooted after a power failure, and this
morning submitting the form results in a 404 "The resource cannot be
found". The exception is:
[HttpException]: The file '/~/direct.aspx' does not exist.
at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath
virtualPath)
[...]

The url in the location bar is like:
http://example.com/~/direct.aspx
Which suggests to me that the ~ is not being translated as it should.

I have fixed it by making the url absolute, but we would like to know
what caused this problem. Has there been some update to IIS? Or what
configuration changes on the machine could cause ~ to stop working?

Thanks

Mark Rae [MVP]

unread,
Mar 3, 2009, 8:13:57 PM3/3/09
to
"davidkclark" <david...@gmail.com> wrote in message
news:2d34f110-bfce-4270...@e36g2000prg.googlegroups.com...

> I have an ASP.NET website that has been running fine for some months.
> It is a very simple single page form that submits back to itself. The
> action for the form happens to use the virtual root token: action="~/
> direct.aspx"

Not quite sure what you're doing here... ASP.NET pages submit to themselves
automatically - that's what postbacks are - there's no need to specify an
action attribute for the form tag...

Please post the markup and code-behind for the page...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

0 new messages