开发者

What are the MUSTS for having an asp.Net application to support BACK button of the browser?

Is there any pattern or kin开发者_开发知识库d of "least requirements list" to follow for ensuring an asp.NET application to support BACK button of the browser for each aspx page?

thanks


In general, the back button on the browser will take you to the previous HTML GET or POST that occurred. It navigates by page-wide transactions, so anything done dynamically cannot be navigated that way. Also, the back button doesn't rewind code execution, so if you are determining something based off of a Session variable or something similar, that won't be rewound either. Obviously, it won't rewind database transactions either.

In general, if you want to support the back button, you'll need to make sure to divide everything you need to navigate between with said button is divided by an HTML transaction of some sort.

Again, you're going to run into issues if your page display is dependent on server-side control that changes from one post to the next. This is one reason you see some forms feed a 'Page has expired' error when you try to navigate back to them.


Not really... It depends on your application flow. There are things that make supporting the back button more awkward.

for example using pure ajax to change the majority of the content on the page, will look like a 'new' page but wont be compatible with the back button (though you can fudge it)

another example is posting back to the same page more than once, as this can make it appear like the back button is not working, and at the same time re-doing your request (and therefore database transactions)

Fundamentally it depends on your application requirements.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜