什么是处理几个自动重定向的正确方法? [英] What is the proper way to handle several automatic redirects?

查看:207
本文介绍了什么是处理几个自动重定向的正确方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,基本上允许客户构建一个与车可配置的项目。用户会选择一个项目,他们将被提示选择他们想要的第一选择,他们会发送到那里挑选自己的第二个选择,等第二个步骤。

I have a website that basically allows customers to build a cart with an item that can be configured. A user will pick an item, and they'll be prompted to pick the first option they want, they get sent to the second step where they pick their second option, etc.

的步骤的数量和选项的数目是可变的,因为它们是由客户端所定义。通常情况下,项目只有2-3个步骤5-10选项。然而,为了使其更快的客户,如果没有可用于给定的步骤只有一种选择,它会自动被选择,并且用户将被发送到下一个步骤。

The number of steps and the number of options are variable, as they are defined by the client. Usually the item only has 2-3 steps with 5-10 options. However, in order to make it faster for the customer, if there is only one option available for the given step, it will automatically be chosen and the user will be sent to the next step.

一个客户端决定成立一个项目有10+步骤,只有一个每一步的选择。这导致自动选择所有的全过程。 Firefox不喜欢这一点,因为它给人的误差

A client decided to set up an item with 10+ steps with only one option for each step. This results in the entire process automatically choosing everything. FireFox doesn't like this, as it gives the error

火狐已检测到服务器
  被重定向这个请求
  在某种程度上解决这个永远
  完整的。

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

(我没有检查IE或Chrome,虽然它很可能使类似的错误)。

(I haven't checked IE or Chrome, although it probably gives similar errors).

什么是解决这一问题的最佳方式?

What's the best way to fix this?

眼下过程基本上


  1. 用户挑选项目

  2. 用户挑选的选择,如果有多个选项可用。否则,该网站确实第3步本身。

  3. POST的选项添加到购物车

  4. 重定向到 Page.aspx?步骤=#

  5. 重复步骤2-4多次必要

有没有什么变化我可以对code或页面,以便Firefox不认为我是在一个无限循环?

Is there any change I can make to the code or page so that FireFox doesn't think I'm in an endless loop?

推荐答案

我很惊讶,如果是#不同,每次你得到无限重定向错误,但无论哪种方式,这似乎并不像最好的架构。基本上,如果code决定的一个步骤可自动完成,它立即重定向到同一页用新的步数?

I am surprised that you get an endless redirect error if # is different each time, but either way, this doesn't seem like the best architecture. Basically, if the code decides a step can be done automatically, it instantly redirects to the same page with the new step number?

你为什么不只是你的code做,没有重定向,递增根据需要在服务器code中的页码,直接告诉他们正确的一步,而不必重定向?

Why don't you just have your code do that without redirecting, increment the page number in the server code as needed, and show them the right step directly, without having to redirect?

当您发布的每一步,我觉得你可以在code很容易地完成,而不必实际做一个新的职位无论发生了什么。

Whatever is happening when you POST at each step I would think you can accomplish just as easily in code without actually having to do a new post.

这篇关于什么是处理几个自动重定向的正确方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆