Why won't postbacks work on my domain root?

孤者浪人 提交于 2019-12-11 04:37:25

问题


I have a form on a masterpage which is very simple but will not work when the site is at the root.

Works fine:

www.mysite.com/page.aspx

www.mysite.com/another/page.aspx

Does not work:

www.mysite.com

I click the button and it postsback to

www.mysite.com/default.aspx

But nothing has executed, now if I try the form again on /default.aspx it will postback and execute fine.

What am I doing wrong?


回答1:


It sounds to me like the default page redirection is either accidentally (or intentionally) losing all form data. I would first suggest not redirecting to a page that doesn't exist.

However, if you insist, I'd try something like URL rewriting. Hopefully a rewrite from a module will keep the form data intact, but I can't say for sure it will. Good luck!




回答2:


Thanks for the reply, I just figured it out!

I am using isapi to make sure my urls are all lower case, and 301 redirecting any upper case URL's to their equivalant lowercase version.

On postback its action is Default.aspx ... My script was redirecting it to default.aspx and loosing the values before it was posted back.. DOH!




回答3:


Do you have an Index.aspx at the root of your site?



来源:https://stackoverflow.com/questions/916258/why-wont-postbacks-work-on-my-domain-root

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!