Steven,
I am sorry, my choice of words was bad. Instead of *menu* I should have said
*control*.
What I am trying to do is have the first of two controls filter what is
displayed in the second control.
For example if in the first CheckBoxList (multi-select) the user selects
'NorthEast' and 'SouthWest' regions then the second CheckBoxList
(multi-select) will display 'Maine', 'New York', 'Nevada' and 'New Mexico'
but will not display 'Oregon' or 'Florida' becuase they are in the
'NorthWest' and 'SouthEast" which were not selected in the first
CheckBoxList.
1.) How do I have the first control supply the parameters for the second
control? I am looking for a good explaination because I am new to aspx. A
link to a very good walk-through - if it is good - would be nice.
Up to now I had set up my controls by using a SqlDataSource. This time I
tried to set my control by putting my queries in a tableAdapter insid my
XSD. While doing this I noticed functionality for setting up parameters. I
would guess thia is how I would set up one contro to be dependant upon
another.
BUT... ( and before setting up parameters)
I tried to run the project to see the controls populate. Instead it crashed
with the error below.
2.) What could I have done wrong?
Thank you,
Doug
=== starr of error ==============
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.
Source Error:
Line 931: this.Adapter.SelectCommand = this.CommandCollection[0];
Line 932: if ((this.ClearBeforeFill == true)) {
Line 933: dataTable.Clear();
Line 934: }
Line 935: int returnValue = this.Adapter.Fill(dataTable);
Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\websiterlftirekingdomcoursecompletionreport\7697443b\2ec251ca\App_Cod
e.9o1brfaa.0.cs
Line: 933
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
ControlsDataSetTableAdapters.CourseGroupsTableAdapter.FillSelectCourseGroups
(CourseGroupsDataTable
dataTable) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary
ASP.NET
Files\websiterlftirekingdomcoursecompletionreport\7697443b\2ec251ca\App_Cod e.9o1brfaa.0.cs:933
[TargetInvocationException: Exception has been thrown by the target of an
invocation.]
System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[]
arguments, SignatureStruct& sig, MethodAttributes methodAttributes,
RuntimeTypeHandle typeOwner) +0
System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[]
arguments, Signature sig, MethodAttributes methodAttributes,
RuntimeTypeHandle typeOwner) +72
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean
skipVisibilityChecks) +358
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +29
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +17
System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSource
Method
method, Boolean disposeInstance, Object& instance) +676
System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelec
tArguments
arguments) +2664
System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +65
System.Web.UI.WebControls.ListControl.PerformSelect() +32
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +99
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +92
System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e)
+33
System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +31
System.Web.UI.WebControls.CheckBoxList.OnPreRender(EventArgs e) +38
System.Web.UI.Control.PreRenderRecursiveInternal() +148
System.Web.UI.Control.PreRenderRecursiveInternal() +233
System.Web.UI.Control.PreRenderRecursiveInternal() +233
System.Web.UI.Control.PreRenderRecursiveInternal() +233
System.Web.UI.Control.PreRenderRecursiveInternal() +233
System.Web.UI.Control.PreRenderRecursiveInternal() +233
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4436
--------------------------------------------------------------------------- -----
Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET
Version:2.0.50727.832
=== end of error ==============