我正在为用户测试不同的登陆页面,并希望 50% 的用户登陆不同的页面。拆分是根据奇数/偶数 IP 地址完成的。但是,我希望登录页面的 URL 相同,但不知道如何执行此操作。到目前为止,这是两个 ActionResult:
[HttpGet]
public ActionResult VerifyVoucherCode()
{
var model = new VerifyVoucherModel();
model.ActivationCode = Request.GetFirstQueryValue("value", "voucher");
return View(model);
}
[HttpGet]
public ActionResult AlternateVerifyVoucherCode()
{
var model = new VerifyVoucherModel();
model.ActivationCode = Request.GetFirstQueryValue("value", "voucher");
return View(model);
}
如您所见,代码完全相同,无论如何我都想避免,但它们对应于不同的 .cshtml 文件和部分文件并显示不同的内容。我希望两者的 URL 都是“SignUp/VerifyVoucher”,但第二个显然目前是“SignUp/AlternateVerifyVoucher”。有什么方法可以让我AlternateVerifyVoucherCode拥有相同的 URL,但显示并匹配不同的剃须刀页面?