所以当我尝试通过文件菜单构建我的网站时,我遇到了标题中提到的错误。导致这种情况的代码如下(出现在 body 标记中的 JavaScript):
if(editedRow != null)
{
var SundayLoc = $find("<%= FieldOpsScheduler_ctl00_ctl05_RCB_SunLocale.ClientID %>");
var MondayLoc = $find("<%= FieldOpsScheduler_ctl00_ctl05_RCB_MonLocale.ClientID %>");
var TuesdayLoc = $find("<%= FieldOpsScheduler_ctl00_ctl05_RCB_TuesLocale.ClientID %>");
var WednesdayLoc = $find("<%= FieldOpsScheduler_ctl00_ctl05_RCB_WedLocale.ClientID %>");
var ThursdayLoc = $find("<%= FieldOpsScheduler_ctl00_ctl05_RCB_ThursLocale.ClientID %>");
var FridayLoc = $find("<%= FieldOpsScheduler_ctl00_ctl05_RCB_FriLocale.ClientID %>");
var SaturdayLoc = $find("<%= FieldOpsScheduler_ctl00_ctl05_RCB_SatLocale.ClientID %>");
if(currentCombo == "OFF" || currentCombo == "OFFICE")
{
if(rcbID == "FieldOpsScheduler_ctl00_ctl05_RCB_SunActivity")
{
SundayLoc.disable();
}
else if(rcbID == "FieldOpsScheduler_ctl00_ctl05_RCB_MonActivity")
{
MondayLoc.disable();
}
else if(rcbID == "FieldOpsScheduler_ctl00_ctl05_RCB_TuesActivity")
{
TuesdayLoc.disable();
}
else if(rcbID == "FieldOpsScheduler_ctl00_ctl05_RCB_WedActivity")
{
WednesdayLoc.disable();
}
else if(rcbID == "FieldOpsScheduler_ctl00_ctl05_RCB_ThursActivity")
{
ThursdayLoc.disable();
}
else if(rcbID == "FieldOpsScheduler_ctl00_ctl05_RCB_FriActivity")
{
FridayLoc.disable();
}
else if(rcbID == "FieldOpsScheduler_ctl00_ctl05_RCB_SatActivity")
{
SaturdayLoc.disable();
}
sender.hideDropDown();
}
else if(currentCombo != "OFF" && currentCombo != "OFFICE")
{
if(rcbID == "FieldOpsScheduler_ctl00_ctl05_RCB_SunActivity")
{
SundayLoc.enable();
}
else if(rcbID == "FieldOpsScheduler_ctl00_ctl05_RCB_MonActivity")
{
MondayLoc.enable();
}
else if(rcbID == "FieldOpsScheduler_ctl00_ctl05_RCB_TuesActivity")
{
TuesdayLoc.enable();
}
else if(rcbID == "FieldOpsScheduler_ctl00_ctl05_RCB_WedActivity")
{
WednesdayLoc.enable();
}
else if(rcbID == "FieldOpsScheduler_ctl00_ctl05_RCB_ThursActivity")
{
ThursdayLoc.enable();
}
else if(rcbID == "FieldOpsScheduler_ctl00_ctl05_RCB_FriActivity")
{
FridayLoc.enable();
}
else if(rcbID == "FieldOpsScheduler_ctl00_ctl05_RCB_SatActivity")
{
SaturdayLoc.enable();
}
sender.hideDropDown();
}
}
现在真正奇怪的(也许是这种情况发生的根本原因)是,当我删除上面的代码时,恰好有一半指出那些 Web 表单元素 ID 名称的错误消失了。但是只有一半——不是全部,这没有意义,因为我摆脱了所有要求 Web 表单元素 ID 的 JavaScript 代码部分。
删除所有相关的 JavaScript 并双击 VS2005 中剩余的 7 条错误消息后,它们都将我带到页面的第一行代码,即:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="DistrictSchedule.aspx.vb" Inherits="FieldOperations_DistrictSchedule" %>
Myself nor my coworker knows what the deuce is going on. When I get rid of half of the errors, at least the page will execute. However it all SHOULD work, judging by the code..
Additional Error Info: I should mention that those web form element IDs that I'm trying to find exist ONLY when my RadGrid is in edit mode, so it would make sense that they're not originally there to begin with. Regardless, this should NOT be causing a site-crippling error, although for whatever reason it is. Lastly, the specific lines throwing the error are the ones utilizing $find, and the lines utilizing the vars that $find gets values for throw the error too.
Whoever out there who can tell me what is going on would be a MAJOR help. I thank you in advance.