L
Luminousc
I get the dreaded, 'is null or not an object' at runtime. This happens
on the:
" if (SearchAndNavFormID.QuickSrchID.value != "") " line.
Here's my ascx source:
<%@ Control Language="c#" AutoEventWireup="false"
Codebehind="DTS_SearchAndNav.ascx.cs"
Inherits="DTS_UI.Components.DTS_SearchAndNav"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<script language="javascript">
function ToggleSelectBox()
{
if (SearchAndNavFormID.QuickSrchID.value !=
""){SearchAndNavFormID.ViewTypeID.disabled = true;}
else {SearchAndNavFormID.ViewTypeID.disabled = false;}
}
</script>
<div align="center" style="BORDER-TOP:black 1px solid; MARGIN-TOP:5px;
MARGIN-BOTTOM:5px; PADDING-BOTTOM:3px; WIDTH:400px; PADDING-TOP:1px;
BORDER-BOTTOM:black 1px solid;>
<div id="tommy" align="center" style="filter:alpha(starty=0,
finishy=100, startx=0, finishx=0, opacity=60, finishopacity=100,
style=1); WIDTH:400px; BACKGROUND-COLOR:#A0A0D0">
<form name="SearchAndNavForm" id="SearchAndNavFormID"
action="DTSList.aspx" method="post" style="margin:0px, padding:0px">
<small style="FONT-SIZE:9px; Color:#000000">Quick Search
<input onblur="ToggleSelectBox()" type="text" name="QuickSrch"
id="QuickSrchID" style="MARGIN-TOP:2px; FONT-SIZE:11px; WIDTH:140px;
BACKGROUND-COLOR:white"><span style="WIDTH:1px"></span></small>
<select ID="ViewTypeID" name="ViewType" style="FONT-SIZE:9px;
WIDTH:106px; BACKGROUND-COLOR:white">
<option <%if ((Session["gl_ViewType"] as string).ToLower() ==
"newreqs"){Response.Write("selected");};%> value="NewReqs"
style="FONT-WEIGHT:800" selected>New Requests</option>
<option <%if ((Session["gl_ViewType"] as string).ToLower() ==
"myreqs"){Response.Write("selected");};%> value="MyReqs"
style="FONT-WEIGHT:800">My Requests</option>
<option <%if ((Session["gl_ViewType"] as string).ToLower() ==
"mywishreqs"){Response.Write("selected");};%> value="mywishreqs"
style="FONT-WEIGHT:800">My Wish List</option>
<option <%if ((Session["gl_ViewType"] as string).ToLower() ==
"wishreqs"){Response.Write("selected");};%> value="wishreqs"
style="FONT-WEIGHT:800">Main Wish List</option>
<option <%if ((Session["gl_ViewType"] as string).ToLower() ==
"exreqs"){Response.Write("selected");};%> value="exreqs"
style="FONT-WEIGHT:800">Other Requests</option>
</select>
<input type="submit" value="GO" style="MARGIN-TOP:2px;
FONT-SIZE:9px; WIDTH:23px; BACKGROUND-COLOR:white" ID="SubmitBtnID"
NAME="SubmitBtn">
<br>
<input type="button" onclick="location.href='DTSSearch.asp'"
style="MARGIN-TOP:2px; FONT-SIZE:9px; WIDTH:214px;
BACKGROUND-COLOR:white"
value="Advanced Request Search"> <span
style="WIDTH:1px"></span><input type="button"
onclick="window.open('DTSNewReqWiz.asp','NewReqWin','width=350,height=250,toolbars=no,statusbar=no')"
style="MARGIN-TOP:2px; FONT-SIZE:9px; WIDTH:133px;
BACKGROUND-COLOR:white" value="New Request Wizard">
</div>
</div>
</form>
on the:
" if (SearchAndNavFormID.QuickSrchID.value != "") " line.
Here's my ascx source:
<%@ Control Language="c#" AutoEventWireup="false"
Codebehind="DTS_SearchAndNav.ascx.cs"
Inherits="DTS_UI.Components.DTS_SearchAndNav"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<script language="javascript">
function ToggleSelectBox()
{
if (SearchAndNavFormID.QuickSrchID.value !=
""){SearchAndNavFormID.ViewTypeID.disabled = true;}
else {SearchAndNavFormID.ViewTypeID.disabled = false;}
}
</script>
<div align="center" style="BORDER-TOP:black 1px solid; MARGIN-TOP:5px;
MARGIN-BOTTOM:5px; PADDING-BOTTOM:3px; WIDTH:400px; PADDING-TOP:1px;
BORDER-BOTTOM:black 1px solid;>
<div id="tommy" align="center" style="filter:alpha(starty=0,
finishy=100, startx=0, finishx=0, opacity=60, finishopacity=100,
style=1); WIDTH:400px; BACKGROUND-COLOR:#A0A0D0">
<form name="SearchAndNavForm" id="SearchAndNavFormID"
action="DTSList.aspx" method="post" style="margin:0px, padding:0px">
<small style="FONT-SIZE:9px; Color:#000000">Quick Search
<input onblur="ToggleSelectBox()" type="text" name="QuickSrch"
id="QuickSrchID" style="MARGIN-TOP:2px; FONT-SIZE:11px; WIDTH:140px;
BACKGROUND-COLOR:white"><span style="WIDTH:1px"></span></small>
<select ID="ViewTypeID" name="ViewType" style="FONT-SIZE:9px;
WIDTH:106px; BACKGROUND-COLOR:white">
<option <%if ((Session["gl_ViewType"] as string).ToLower() ==
"newreqs"){Response.Write("selected");};%> value="NewReqs"
style="FONT-WEIGHT:800" selected>New Requests</option>
<option <%if ((Session["gl_ViewType"] as string).ToLower() ==
"myreqs"){Response.Write("selected");};%> value="MyReqs"
style="FONT-WEIGHT:800">My Requests</option>
<option <%if ((Session["gl_ViewType"] as string).ToLower() ==
"mywishreqs"){Response.Write("selected");};%> value="mywishreqs"
style="FONT-WEIGHT:800">My Wish List</option>
<option <%if ((Session["gl_ViewType"] as string).ToLower() ==
"wishreqs"){Response.Write("selected");};%> value="wishreqs"
style="FONT-WEIGHT:800">Main Wish List</option>
<option <%if ((Session["gl_ViewType"] as string).ToLower() ==
"exreqs"){Response.Write("selected");};%> value="exreqs"
style="FONT-WEIGHT:800">Other Requests</option>
</select>
<input type="submit" value="GO" style="MARGIN-TOP:2px;
FONT-SIZE:9px; WIDTH:23px; BACKGROUND-COLOR:white" ID="SubmitBtnID"
NAME="SubmitBtn">
<br>
<input type="button" onclick="location.href='DTSSearch.asp'"
style="MARGIN-TOP:2px; FONT-SIZE:9px; WIDTH:214px;
BACKGROUND-COLOR:white"
value="Advanced Request Search"> <span
style="WIDTH:1px"></span><input type="button"
onclick="window.open('DTSNewReqWiz.asp','NewReqWin','width=350,height=250,toolbars=no,statusbar=no')"
style="MARGIN-TOP:2px; FONT-SIZE:9px; WIDTH:133px;
BACKGROUND-COLOR:white" value="New Request Wizard">
</div>
</div>
</form>