点击我网页上的一个元素后,我会从跟踪中的Response.Redirect中得到预期的行为,期望页面上的断点被击中并继续正常处理。但是,当我期望新页面被加载时,浏览器中的显示不会改变。它的外观和行为就像点击将您带回到同一页面。Response.Redirect不变URL
我搬到重定向召唤出一个try-catch块,并用HttpContext的... CompleteRequest()尝试的真/假的不同组合作为第二个参数
什么可能阻止一个网页在从Response.Redirect调用并且Page_Load子类完成后加载?
编辑:
该网站使用CSS和JavaScript创建一个包含自引用链接的可移动下拉菜单,请参见下文。我曾尝试使用Chrome的开发工具来查看网络正在处理的内容。据我所知,通过阅读“网络”选项卡,点击正在创建正确的呼叫;状态200,键入xhr。 xhr是我发现的唯一奇怪的东西,但看起来这只是对ajax的引用?这使我处于相同的位置。我告诉网站重定向到新的网址,并且我看到网络接受了该网址的请求,但地址栏中的网址没有更改;而不是显示的页面。
$(document).on('click','.navigation', function() {
loadItems($(this).attr('id'), $(this).attr('itemName'));
return false;
}
);
var loadItems = function (id, itemName) {
var editInfor =
{
"method": "getChildItems",
"id": id
};
$.ajax
(
{
type: "POST",
url: $.url,
dataType: "json",
data: JSON.stringify(editInfor),
success: function (jsonReply) {
$("#chkEnabled").attr('checked', jsonReply.enabled)
if (jsonReply.method == 'getChildItems') {
$("#childrens").html('');
var html = '<table>'
if (jsonReply.successfull) {
$.each(jsonReply.children, function (i, item) {
html += '<tr><td><span class="children">' + item.text + '</span></td><td><a class="moveItemUp btn" href="#" id="moveItemUp' + item.id + '">Move Up <i class="icon-circle-arrow-up"></i></a> <a class="moveItemDown btn" href="#" id="moveItemDown' + item.id + '">Move Down <i class="icon-circle-arrow-down"></i></a></td><td><a href="#" class="removeItem btn btn-danger" id="removeItem' + item.id + '">Remove</a></td></tr>'
});
}
html += '</table>'
$($.childrens).html(html);
}
}
}
);
那是否要重定向也有代码的页面将您重定向回原来的网页上加载? – N0Alias
@NoAlias:不,只需双重检查 –