【发布时间】:2011-07-12 15:13:34
【问题描述】:
我有一个 Intranet 应用程序,它由一个列表框组成,当用户双击一个项目时,它使用 javascript 将 iFrame 的源设置为关联的 aspx 页面(页面名称是列表框的值)。像这样:
function GetLetterForm()
{
$find('ModalPopupExtender1').show();
$("#ltrVariables").attr('src', $("#lstNames").val() + ".aspx"); //these two lines are interchangeable
//document.ltrVariables.location = document.getElementById("<%= lstNames.clientID %>").value + ".aspx";
$find('ModalPopupExtender1').hide();
}
它有效,但我仍然有一个问题。有时,列表框中的值没有关联的网页。例如,选择“Bob”的值为 438,但我没有 438.aspx 网页。
所以我在 iFrame 中收到“服务器错误 - 找不到资源”。不漂亮。
我想做的是(以某种方式)挂钩错误,并在发生这种情况时显示一般的“对不起,狗吃了我的作业”aspx 页面。
但我不知道如何做到这一点。
任何想法都将不胜感激。
谢谢,
杰森
编辑:我真的不想使用 IIS 处理这个,因为我的母版页有一个单独的错误网页。谢谢!
【问题讨论】: