3

I have a number of virtual applications under one site, all of which have the same issue. Whenever you are at the root of the application (~/) postbacks do not fire, the page just refreshes.

Here are some samples (all their own virtual applications):

Clicking on "Login" link does not redirect to Login.aspx page

Entering username / password, and then clicking "login" / "go" does not log a user in

For some reason, if you add "Default.aspx" to the end of any of the pages above the postback works as expected (eg. http://designbyssi.com/designbyssi.com/projects/air-savings/02/Default.aspx). I've been Googling this for a while now and I found a few articles, though none of them have helped. Here are the articles I've managed to find:

I'm not using any type of URL rewriting, they are all web form applications, and I'm on a Godaddy shared hosting account.

Any ideas on what might be happening, or what I need to do to fix it?

Community
  • 1
  • 1
pharophy
  • 771
  • 2
  • 8
  • 16

1 Answers1

1

I had the same issue recently where my dev environment was setup in integrated mode while production was in classic mode. Postbacks in dev were not working when going to the root of the site but would work when going to Default.aspx.

I simply changed my dev environment to use classic mode for now. Also, this problem does not necessarily have anything to do with URL rewriting.

Since you are on shared hosting, you probably can't do that but these links may help.

Postback doesn't work with aspx page as Default Document

Event Handlers Might Not Be Not Raised in a Default Document in IIS 7 or IIS 7.5 Integrated Mode?

Community
  • 1
  • 1
  • Thank you for your quick reply, this seems like the issue. I've added the following code in my base-page Render event: `if (string.IsNullOrEmpty(this.Form.Action) || this.Form.Action == "/") this.Form.Action = "/default.aspx";`. Of course, as soon as I try to test this, my Godaddy site goes down.. There's godaddy for you. Anyway I'll test as soon as I can, and mark this as the answer as soon as it's confirmed. Thanks again. – pharophy May 16 '12 at 02:04
  • Hi Romany, So, I really didn't want to change to Classic Mode, as I can't map HTTPModules to run it for all requests that way (to my knowledge). So I looked into the code in my base-page render event, and modified it like so, and it seems to have done the trick: `if (HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath.ToLower() == "~/default.aspx" || HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath.ToLower() == "~/") this.Form.Action = "default.aspx";` Thanks for your help. – pharophy May 17 '12 at 01:56