版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
PAGEPAGE30Master/DetailFilteringWithTwoDropDownListsIntroductionIntheprevioustutorialweexaminedhowtodisplayasimplemaster/detailsreportusingasingleDropDownListpopulatedwiththecategoriesandaGridViewshowingthoseproductsthatbelongtotheselectedcategory.Thisreportpatternworkswellwhendisplayingrecordsthathaveaone-to-manyrelationshipandcaneasilybeextendedtoworkforscenariosthatincludemultipleone-to-manyrelationships.Forexample,anorderentrysystemwouldhavetablesthatcorrespondtocustomers,orders,andorderlineitems.Agivencustomermayhavemultipleorderswitheachorderconsistingofmultipleitems.SuchdatacanbepresentedtotheuserwithtwoDropDownListsandaGridView.ThefirstDropDownListwouldhavealistitemforeachcustomerinthedatabasewiththesecondone'scontentsbeingtheordersplacedbytheselectedcustomer.AGridViewwouldlistthelineitemsfromtheselectedorder.WhiletheNorthwinddatabaseincludethecanonicalcustomer/order/orderdetailsinformationinitsCustomers,Orders,andOrderDetailstables,thesetablesaren'tcapturedinourarchitecture.Nonetheless,wecanstillillustrateusingtwodependentDropDownLists.ThefirstDropDownListwilllistthecategoriesandthesecondtheproductsbelongingtotheselectedcategory.ADetailsViewwillthenlistthedetailsoftheselectedproduct.Step1:CreatingandPopulatingtheCategoriesDropDownListOurfirstgoalistoaddtheDropDownListthatliststhecategories.Thesestepswereexaminedindetailintheprecedingtutorial,butaresummarizedhereforcompleteness.OpentheMasterDetailsDetails.aspxpageintheFilteringfolder,addaDropDownListtothepage,setitsIDpropertytoCategories,andthenclicktheConfigureDataSourcelinkinitssmarttag.FromtheDataSourceConfigurationWizardchoosetoaddanewdatasource.
Figure1:AddaNewDataSourcefortheDropDownList(Clicktoviewfull-sizeimage)Thenewdatasourceshould,naturally,beanObjectDataSource.NamethisnewObjectDataSourceCategoriesDataSourceandhaveitinvoketheCategoriesBLLobject'sGetCategories()method.Figure2:ChoosetoUsetheCategoriesBLLClass(Clicktoviewfull-sizeimage)Figure3:ConfiguretheObjectDataSourcetoUsetheGetCategories()Method(Clicktoviewfull-sizeimage)AfterconfiguringtheObjectDataSourcewestillneedtospecifywhichdatasourcefieldshouldbedisplayedintheCategoriesDropDownListandwhichoneshouldbeconfiguredasthevalueforthelistitem.SettheCategoryNamefieldasthedisplayandCategoryIDasthevalueforeachlistitem.Figure4:HavetheDropDownListDisplaytheCategoryNameFieldandUseCategoryIDastheValue(Clicktoviewfull-sizeimage)AtthispointwehaveaDropDownListcontrol(Categories)that'spopulatedwiththerecordsfromtheCategoriestable.WhentheuserchoosesanewcategoryfromtheDropDownListwe'llwantapostbacktooccurinordertorefreshtheproductDropDownListthatwe'regoingtocreateinStep2.Therefore,checktheEnableAutoPostBackoptionfromthecategoriesDropDownList'ssmarttag.Figure5:EnableAutoPostBackfortheCategoriesDropDownList(Clicktoviewfull-sizeimage)Step2:DisplayingtheSelectedCategory'sProductsinaSecondDropDownListWiththeCategoriesDropDownListcompleted,ournextstepistodisplayaDropDownListofproductsbelongingtotheselectedcategory.Toaccomplishthis,addanotherDropDownListtothepagenamedProductsByCategory.AswiththeCategoriesDropDownList,createanewObjectDataSourcefortheProductsByCategoryDropDownListnamedProductsByCategoryDataSource.Figure6:AddaNewDataSourcefortheProductsByCategoryDropDownList(Clicktoviewfull-sizeimage)Figure7:CreateaNewObjectDataSourceNamedProductsByCategoryDataSource(Clicktoviewfull-sizeimage)SincetheProductsByCategoryDropDownListneedstodisplayjustthoseproductsbelongingtotheselectedcategory,havetheObjectDataSourceinvoketheGetProductsByCategoryID(categoryID)methodfromtheProductsBLLobject.Figure8:ChoosetoUsetheProductsBLLClass(Clicktoviewfull-sizeimage)Figure9:ConfiguretheObjectDataSourcetoUsetheGetProductsByCategoryID(categoryID)Method(Clicktoviewfull-sizeimage)InthefinalstepofthewizardweneedtospecifythevalueofthecategoryIDparameter.AssignthisparametertotheselecteditemfromtheCategoriesDropDownList.Figure10:PullthecategoryIDParameterValuefromtheCategoriesDropDownList(Clicktoviewfull-sizeimage)WiththeObjectDataSourceconfigured,allthatremainsistospecifywhatdatasourcefieldsareusedforthedisplayandvalueoftheDropDownList'sitems.DisplaytheProductNamefieldandusetheProductIDfieldasthevalue.Figure11:SpecifytheDataSourceFieldsUsedfortheDropDownList'sListItems'TextandValueProperties(Clicktoviewfull-sizeimage)WiththeObjectDataSourceandProductsByCategoryDropDownListconfiguredourpagewilldisplaytwoDropDownLists:thefirstwilllistallofthecategorieswhilethesecondwilllistthoseproductsbelongingtotheselectedcategory.WhentheuserselectsanewcategoryfromthefirstDropDownList,apostbackwillensueandthesecondDropDownListwillberebound,showingthoseproductsthatbelongtothenewlyselectedcategory.Figures12and13showMasterDetailsDetails.aspxinactionwhenviewedthroughabrowser.Figure12:WhenFirstVisitingthePage,theBeveragesCategoryisSelected(Clicktoviewfull-sizeimage)Figure13:ChoosingaDifferentCategoryDisplaystheNewCategory'sProducts(Clicktoviewfull-sizeimage)CurrentlytheproductsByCategoryDropDownList,whenchanged,doesnotcauseapostback.However,wewillwantapostbacktooccuronceweaddaDetailsViewtodisplaytheselectedproduct'sdetails(Step3).Therefore,checktheEnableAutoPostBackcheckboxfromtheproductsByCategoryDropDownList'ssmarttag.Figure14:EnabletheAutoPostBackFeaturefortheproductsByCategoryDropDownList(Clicktoviewfull-sizeimage)Step3:UsingaDetailsViewtoDisplayDetailsfortheSelectedProductThefinalstepistodisplaythedetailsfortheselectedproductinaDetailsView.Toaccomplishthis,addaDetailsViewtothepage,setitsIDpropertytoProductDetails,andcreateanewObjectDataSourceforit.ConfigurethisObjectDataSourcetopullitsdatafromtheProductsBLLclass'sGetProductByProductID(productID)methodusingtheselectedvalueoftheProductsByCategoryDropDownListforthevalueoftheproductIDparameter.Figure15:ChoosetoUsetheProductsBLLClass(Clicktoviewfull-sizeimage)Figure16:ConfiguretheObjectDataSourcetoUsetheGetProductByProductID(productID)Method(Clicktoviewfull-sizeimage)Figure17:PulltheproductIDParameterValuefromtheProductsByCategoryDropDownList(Clicktoviewfull-sizeimage)YoucanchoosetodisplayanyoftheavailablefieldsintheDetailsView.I'veoptedtoremovetheProductID,SupplierID,andCategoryIDfieldsandreorderedandformattedtheremainingfields.Inaddition,IclearedouttheDetailsView'sHeightandWidthproperties,allowingtheDetailsViewtoexpandtothewidthneededtobestdisplayitsdataratherthanhavingitconstrainedtoaspecifiedsize.Thefullmarkupappearsbelow:<asp:DetailsViewID="ProductDetails"runat="server"AutoGenerateRows="False"DataKeyNames="ProductID"DataSourceID="ObjectDataSource1"EnableViewState="False"><Fields><asp:BoundFieldDataField="ProductName"HeaderText="Product"SortExpression="ProductName"/><asp:BoundFieldDataField="CategoryName"HeaderText="Category"ReadOnly="True"SortExpression="CategoryName"/><asp:BoundFieldDataField="SupplierName"HeaderText="Supplier"ReadOnly="True"SortExpression="SupplierName"/><asp:BoundFieldDataField="QuantityPerUnit"HeaderText="Qty/Unit"SortExpression="QuantityPerUnit"/><asp:BoundFieldDataField="UnitPrice"DataFormatString="{0:c}"HeaderText="Price"HtmlEncode="False"SortExpression="UnitPrice"/><asp:BoundFieldDataField="UnitsInStock"HeaderText="UnitsInStock"SortExpression="UnitsInStock"/><asp:BoundFieldDataField="UnitsOnOrder"HeaderText="UnitsOnOrder"SortExpression="UnitsOnOrder"/><asp:BoundFieldDataField="ReorderLevel"HeaderText="ReorderLevel"SortExpression="ReorderLevel"/><asp:CheckBoxFieldDataField="Discontinued"HeaderText="Discontinued"SortExpression="Discontinued"/></Fields></asp:DetailsView>TakeamomenttotryouttheMasterDetailsDetails.aspxpageinabrowser.Atfirstglanceitmayappearthateverythingisworkingasdesired,butthere'sasubtleproblem.WhenyouchooseanewcategorytheProductsByCategoryDropDownListisupdatedtoincludethoseproductsfortheselectedcategory,buttheProductDetailsDetailsViewcontinuedtoshowthepreviousproductinformation.TheDetailsViewisupdatedwhenchoosingadifferentproductfortheselectedcategory.Furthermore,ifyoutestthoroughlyenough,you'llfindthatifyoucontinuallychoosenewcategories(suchaschoosingBeveragesfromtheCategoriesDropDownList,thenCondiments,thenConfections)everyothercategoryselectioncausestheProductDetailsDetailsViewtoberefreshed.Tohelpconcretizethisproblem,let'slookataspecificexample.WhenyoufirstvisitthepagetheBeveragescategoryisselectedandtherelatedproductsareloadedintheProductsByCategoryDropDownList.ChaiistheselectedproductanditsdetailsaredisplayedintheProductDetailsDetailsView,asshowninFigure18.
Figure18:TheSelectedProduct'sDetailsareDisplayedinaDetailsView(Clicktoviewfull-sizeimage)IfyouchangethecategoryselectionfromBeveragestoCondiments,apostbackoccursandtheProductsByCategoryDropDownListisupdatedaccordingly,buttheDetailsViewstilldisplaysdetailsforChai.Figure19:ThePreviouslySelectedProduct'sDetailsareStillDisplayed(Clicktoviewfull-sizeimage)PickinganewproductfromthelistrefreshestheDetailsViewasexpected.Ifyoupickanewcategoryafterchangingtheproduct,theDetailsViewagainwon'trefresh.However,ifinsteadofchoosinganewproductyouselectedanewcategory,theDetailsViewwouldrefresh.Whatintheworldisgoingonhere?Theproblemisatimingissueinthepage'slifecycle.Wheneverapageisrequesteditproceedsthroughanumberofstepsasitsrendering.InoneofthesestepstheObjectDataSourcecontrolschecktoseeifanyoftheirSelectParametersvalueshavechanged.Ifso,thedataWebcontrolboundtotheObjectDataSourceknowsthatitneedstorefreshitsdisplay.Forexample,whenanewcategoryisselected,theProductsByCategoryDataSourceObjectDataSourcedetectsthatitsparametervalueshavechangedandtheProductsByCategoryDropDownListrebindsitself,gettingtheproductsfortheselectedcategory.TheproblemthatarisesinthissituationisthatthepointinthepagelifecyclethattheObjectDataSourcescheckforchangedparametersoccursbeforetherebindingoftheassociateddataWebcontrols.Therefore,whenselectinganewcategorytheProductsByCategoryDataSourceObjectDataSourcedetectsachangeinitsparameter'svalue.TheObjectDataSourceusedbytheProductDetailsDetailsView,however,doesn'tnoteanysuchchangesbecausetheProductsByCategoryDropDownListhasyettoberebound.LaterinthelifecycletheProductsByCategoryDropDownListrebindstoitsObjectDataSource,grabbingtheproductsforthenewlyselectedcategory.WhiletheProductsByCategoryDropDownList'svaluehaschanged,theProductDetailsDetailsView'sObjectDataSourcehasalreadydoneitsparametervaluecheck;therefore,theDetailsViewdisplaysitspreviousresults.ThisinteractionisdepictedinFigure20.Figure20:TheProductsByCategoryDropDownListValueChangesAftertheProductDetailsDetailsView'sObjectDataSourceChecksforChanges(Clicktoviewfull-sizeimage)ToremedythisweneedtoexplicitlyrebindtheProductDetailsDetailsViewaftertheProductsByCategoryDropDownListhasbeenbound.WecanaccomplishthisbycallingtheProductDetailsDetailsView'sDataBind()methodwhentheProductsByCategoryDropDownList'sDataBoundeventfires.AddthefollowingeventhandlercodetotheMasterDetailsDetails.aspxpage'scode-behindclass(refertothe"ProgrammaticallySettingtheObjectDataSource'sParameterValues"foradiscussiononhowtoaddaneventhandler):protectedvoidProductsByCategory_DataBound(objectsender,EventArgse){ProductDetails.DataBind();}AfterthisexplicitcalltotheProductDetailsDetailsView'sDataBind()methodhasbeenadded,thetutorialworksasexpected.Figure21highlightshowthischangedremediedourearlierproblem.Figure21:TheProductDetailsDetailsViewisExplicitlyRefreshedWhentheProductsByCategoryDropDownList'sDataBoundEventFires(Clicktoviewfull-sizeimage)SummaryTheDropDownListservesasanidealuserinterfaceelementformaster/detailreportswherethereisaone-to-manyrelationshipbetweenthemasteranddetailrecords.IntheprecedingtutorialwesawhowtouseasingleDropDownListtofiltertheproductsdisplayedbytheselectedcategory.InthistutorialwereplacedtheGridViewofproductswithaDropDownList,andusedaDetailsViewtodisplaythedetailsoftheselectedproduct.Theconceptsdiscussedinthistutorialcaneasilybeextendedtodatamodelsinvolvingmultipleone-to-manyrelationships,suchascustomers,orders,andorderitems.Ingeneral,youcanalwaysaddaDropDownListforeachofthe"one"entitiesintheone-to-manyrelationships.HappyProgramming!AbouttheAuthorScottMitchell,authorofsevenASP/ASP.NETbooksandfounderof4GuysFromR,hasbeenworkingwithMicrosoftWebtechnologiessince1998.Scottworksasanindependentconsultant,trainer,andwriter.HislatestbookisSamsTeachYourselfASP.NET2.0in24Hours.Hecanbereachedatmitchell@4GuysFromR.orviahisblog,whichcanbefoundathttp://ScottOnWriting.NET.ThearticleisfrompartofWorkingwithDatainASP.NET2.0.Site:/learn/dataaccess/default.aspx
使用两个DropDownList过滤的主/从报表导言在前面的指南中我们研究了如何显示一个简单的主/从报表,该报表使用DropDownList和GridView控件,DropDownList填充类别,GridView显示选定类别的产品。这类报表用于显示具有一对多关系的记录时非常合适,同时它也可以很容易的被扩展以显示多个一对多关系的数据。比如,一个订单系统应该包含表示客户,订单和订单明细的表。一个客户也许有多个订单,每个订单又包含多条订单项。这样的数据可以使用两个DropDownList和一个GridView呈现给用户。第一个DropDownList应该包含数据库中所有客户的列表,第二个DropDownList的内容是选定客户的订单。GridView用于列出所选定订单的订单明细项。第一步:创建DropDownList并使用类别数据填充我们的第一个目标是添加一个能够列出类别的DropDownList。这些步骤在前面的指南中已经做详细的分析,但为了保持本篇指南的完整性有必要在这里简单概括一下。打开Filtering文件夹中的MasterDetailsDetails.aspx,在页面上添加一个DropDownList,设置它的ID为Categories,然后单击智能标记上的ConfigureDataSource链接。在数据源配置向导中选择新增一个数据源。图1为DropDownList增加一个新的数据源当然,新的数据源应该是ObjectDataSource。把新的ObjectDataSource命名为CategoriesDataSource并且让他调用CategoriesBLL对象的GetCategories()方法图2选择使用CategoriesBLL类图3配置ObjectDataSource使用GetCategories()方法配置完ObjectDataSource后还需要指定要在DropDownList中显示的数据字段,以及作为数据项的值(valueforthelistitem)的数据字段。我们指定CategoryName为要显示的列,指定CategoryID为数据项的值字段图4指定DropDownList显示CategoryName列并且使用CategoryID列作为数据项的值这时,我们就有了一个使用Categories表中的记录来填充的DropDownList控件。当用户在DropDownList中选择一个新的类别时,我们需要一次回发,这样可以刷新在第二步中我们要创建的产品DropDownList控件。所以,categoriesDropDownList的智能标记上选中AutoPostBack选项。图5选中CategoriesDropDownList的AutoPostBack第二步:在第二个DropDownList中显示选中类别的产品CategoriesDropDownList完成后,下一步就需要一个显示属于选定类别的产品的DropDownList了。要完成这个功能,再增加一个DropDownList控件并命名为ProductsByCategory。与CategoriesDropDownList一样,为ProductsByCategoryDropDownList创建一个新的ObjectDataSource并命名为ProductsByCategoryDataSource。图6为ProductsByCategoryDropDownList添加新数据源图7创建一个新的ObjectDataSource并命名为ProductsByCategoryDataSource由于ProductsByCategoryDropDownList需要显示属于选定类别的产品,让ObjectDataSource调用ProductsBLL对象的GetProductsByCategoryID(categoryID)方法。图8选择使用ProductsBLL类图9配置ObjectDataSource使用GetProductsByCategoryID(categoryID)方法在向导的最后一步需要指定categoryID的值。我们把CategoriesDropDownList的已选择的数据项项作为该参数值。图10使用categoryID参数从CategoriesDropDownList接收值ObjectDataSource配置完成后,剩下的就是指定DropDownList要显示的字段和作为值的字段了。设置为显示ProductName并把ProductID做为值字段图11指定DropDownList数据项的文本和值使用的数据源字段ObjectDataSource和ProductsByCategoryDropDownList配置完成后页面上会有两个DropDownList:第一个列出所有的类别,第二个列出属于选定类别的产品。当用户在第一个DropDownList上选择了一个新的类别后,将会发生一次回发(postback),第二个DropDownList将会重新绑定以显示属于新选定类别的产品。图12和图13显示了在浏览器中看到的MasterDetailsDetails.aspx页面。图12第一次访问页面时Beverages类别是选中的。图13选择一个不同的类别时显示该类别的产品图14激活productsByCategoryDropDownList的AutoPostBack属性第三步:使用详细视图来显示所选择的产品详细信息最后一个步骤是在DetailsView中显示选中产品的详细信息。要完成该功能,添加一个DetailsView到页面上,设置它的ID属性为ProductDetails,给它创建一个新的ObjectDataSource。配置ObjectDataSource使它通过ProductsBLL类的GetProductByProductID(productID)方法填充数据,使用ProductsByCategoryDropDownList的已选择项的值作为productID参数的值。图15选择使用ProductsBLL类图16配置ObjectDataSource使用GetProductByProductID(productID)方法图17使用ProductsByCategoryDropDownList的值作为productID参数的值你可以选择在DetailsView显示的任何有效的字段。我决定不显示ProductID,SupplierID,和CategoryID字段并且对其余的字段重新排序及格式化。另外,我去掉了DetailsView的Height和Width属性设置,允许DetailsView可以扩展到需要的宽度,这样比把它限制在指定的大小会更好的显示数据。下面便是全部的标记性语言(markup):<asp:DetailsViewID="ProductDetails"runat="server"AutoGenerateRows="False"DataKeyNames="ProductID"DataSourceID="ObjectDataSource1"EnableViewState="False"><Fields><asp:BoundFieldDataField="ProductName"HeaderText="Product"SortExpression="ProductName"/><asp:BoundFieldDataField="CategoryName"HeaderText="Category"ReadOnly="True"SortExpression="CategoryName"/><asp:BoundFieldDataField="SupplierName"HeaderText="Supplier"ReadOnly="True"SortExpression="SupplierName"/><asp:BoundFieldDataField="QuantityPerUnit"HeaderText="Qty/Unit"SortExpression="QuantityPerUnit"/><asp:BoundFieldDataField="UnitPrice"DataFormatString="{0:c}"HeaderText="Price"HtmlEncode="False"SortExpression="UnitPrice"/><asp:BoundFieldDataField="UnitsInStock"HeaderText="UnitsInStock"SortExpression="UnitsInStock"/><asp:BoundFieldDataField="UnitsOnOrder"HeaderText="UnitsOnOrder"SortExpression="UnitsOnOrder"/><asp:BoundFieldDataField="ReorderLevel"HeaderText="ReorderLevel"SortExpression="ReorderLevel"/><asp:CheckBoxFieldDataField="Discontinued"HeaderText="Discontinued"SortExpression="Discontinued"/></Fields></asp:DetailsView>花点时间在浏览器中测试一下MasterDetailsDetails.aspx页面。乍一看好像一切如预计的那样顺利,但是却有一个小问题。当你选择了一个新类别,ProductsByCategoryDropDownList会更新显示选中类别的产品,但是ProductDetailsDetailsView还是显示上一个产品的信息。当选择了一个选中类别的不同的产品时DetailsView应该被更新。此外,如果你的测试足够彻底,你将会发现如果你不断的选择新类别(比如在CategoriesDropDownList中选择Beverages,然后选择Condiments,然后是Confections)每个类别的选择都会使ProductDetailsDetailsView被刷新。为了让这个问题更具体一些,让我们看一个例子。当你第一次访问该页面时,Beverages类别是选中的并且与之相关的产品在ProductsByCategoryDropDownList中列出。Chai是当前选中的产品,他的详细信息显示在ProductDetailsDetailsView中,如图18。图18DetailsView显示了选中产品的详细信息如果你把类别选项Beverages改成Condiments,便会发生一次回发,ProductsByCategoryDropDownList会相应的更新,但是DetailsView仍然会显示Chai的详细信息。图19上一次选择产品的详细信息仍然在显示在列表中选择一个产品会如预期地一样刷新DetailsView,如果你改变了产品之后选择了一个新的类别,DetailsView又一次没有刷新。然后如果你选择一个新类别而不是选择一个产品,DetailsView则会刷新。究竟是怎么回事呢?这个问题是由页面生命周期的时间调度引发的。当页面被请求时会经过一系列的处理后呈现出来。这其中的一项处理便是ObjectDataSource控件检查他的SelectParameters值是否发生变化。如果发生了变化,WEB控件绑定到ObjectDataSource的数据便会刷新显示。比如,当一个新类别被选中时,ProductsByCategoryDataSourceObjectDataSource发现它的参数值已经发生了变化,然后ProductsByCategoryDropDownList就会重新绑定,获取所选中类别的产品。在这种情况下发生的该问题是由于在页面的生命周期中ObjectDataSources检查参数是否发生改变的动作是在关联的WEB控件重新绑定之前。因此,当选择了一个新的类别ProductsByCategoryDataSourceObjectDataSource会检查到它的参数值发生了变化。但是,ProductDetailsDetailsView使用的ObjectDataSource并没有发生任何变化,因为ProductsByCategoryDropDownList还没有重新绑定。在稍后的生命周期中ProductsByCategoryDropDownList重新绑定到它的ObjectDataSource,获取刚刚选中类别的产品。当ProductsByCategoryDropDownList的值发生变化的时候ProductDetailsDetailsView的ObjectDataSource已经完成了它的参数值检查工作。因此,DetailsView还是显示先前的数据。图20描述了这个交互的过程。图20TProductDetailsDetailsView的ObjectDataSource的检查工作结束后ProductsByCategoryDropDownList的值才改变要解决这个问题,我们需要在ProductsByCategoryDropDownList绑定后显式的重新绑定ProductDetailsDetailsView。我们可以在ProductsByCategoryDropDownList的DataBound事件中调用ProductDetailsDetailsView的DataBind()方法。把下面的事件处理代码添加到MasterDetailsDetails.aspx页面的代码后置类:protectedvoidProductsByCategory_DataBound(objectsender,EventArgse){ProductDetails。DataBind();}添加对ProductDetailsDetailsView的DataBind()方法的显式调用后,就一切正常了。图21显示了该方法是如何解决这个问题的。图21在ProductsByCategoryDropDownList的DataBound事件中ProductDetailsDetailsView被显示的刷新总结DropDownList控件是一个非常理想的用于主/从报表(主记录和从记录存在一对多关系)的用户接口元素(userinterfaceelement)。在前面的教程中我们看到了如何使用单个DropDownList对选中的类别进行产品过滤。在本教程中我们使用GridView代替了DropDownList做为产品列表,使用DetailsView显示选中产品的详细信息。本教程所讨论的概念可以很容易的扩展到包含多个一对多关系的数据模型,比如客户,订单及订单项。通常,在一对多的关系中你总是可以使用DropDownList来表示"主"实体(一对多中的一,主/从关系的主记录)。祝编程愉快!作者简介ScottMitchell,著有六本ASP/ASP.NET方面的书,是4GuysFromR的创始人,自1998年以来一直应用微软Web技术。Scott是个独立的技术咨询顾问,培训师,作家,最近完成了将由Sams出版社出版的新作,24小时内精通ASP.NET2.0。他的联系电邮为mitchell@4,也可以通过他的博客http://ScottOnWriting.NET与他联系。文章来自“在ASP.NET2.0中的数据处理”的一部分。网址:/learn/dataaccess/default.aspx基于C8051F单片机直流电动机反馈控制系统的设计与研究基于单片机的嵌入式Web服务器的研究MOTOROLA单片机MC68HC(8)05PV8/A内嵌EEPROM的工艺和制程方法及对良率的影响研究基于模糊控制的电阻钎焊单片机温度控制系统的研制基于MCS-51系列单片机的通用控制模块的研究基于单片机实现的供暖系统最佳启停自校正(STR)调节器单片机控制的二级倒立摆系统的研究基于增强型51系列单片机的TCP/IP协议栈的实现基于单片机的蓄电池自动监测系统基于32位嵌入式单片机系统的图像采集与处理技术的研究基于单片机的作物营养诊断专家系统的研究基于单片机的交流伺服电机运动控制系统研究与开发基于单片机的泵管内壁硬度测试仪的研制基于单片机的自动找平控制系统研究基于C8051F040单片机的嵌入式系统开发基于单片机的液压动力系统状态监测仪开发模糊Smith智能控制方法的研究及其单片机实现一种基于单片机的轴快流CO〈,2〉激光器的手持控制面板的研制基于双单片机冲床数控系统的研究基于CYGNAL单片机的在线间歇式浊度仪的研制基于单片机的喷油泵试验台控制器的研制基于单片机的软起动器的研究和设计基于单片机控制的高速快走丝电火花线切割机床短循环走丝方式研究基于单片机的机电产品控制系统开发基于PIC单片机的智能手机充电器基于单片机的实时内核设计及其应用研究基于单片机的远程抄表系统的设计与研究基于单片机的烟气二氧化硫浓度检测仪的研制基于微型光谱仪的单片机系统单片机系统软件构件开发的技术研究基于单片机的液体点滴速度自动检测仪的研制基于单片机系统的多功能温度测量仪的研制基于PIC单片机的电能采集终端的设计和应用基于单片机的光纤光栅解调仪的研制气压式线性摩擦焊机单片机控制系统的研制基于单片机的数字磁通门传感器基于单片机的旋转变压器-数字转换器的研究基于单片机的光纤Bragg光栅解调系统的研究单片机控制的便携式多功能乳腺治疗仪的研制基于C8051F020单片机的多生理信号检测仪基于单片机的电机运动控制系统设计Pico专用单片机核的可测性设计研究基于MCS-51单片机的热量计基于双单片机的智能遥测微型气象站MCS-51单片机构建机器人的实践研究基于单片机的轮轨力检测基于单片机的GPS定位仪的研究与实现基于单片机的电液伺服控制系统用于单片机系统的MMC卡文件系统研制基于单片机的时控和计数系统性能优化的研究基于单片机和CPLD的粗光栅位移测量系统研究单片机控制的后备式方波UPS提升高职学生单片机应用能力的探究基于单片机控制的自动低频减载装置研究基于单片机控制的水下焊接电源的研究基于单片机的多通道数据采集系统基于uPSD3234单片机的氚表面污染测量仪的研制基于单片机的红外测油仪的研究96系列单片机仿真器研究与设计基于单片机的单晶金刚石刀具刃磨设备的数控改造基于单片机的温度智能控制系统的设计与实现基于MSP430单片机的电梯门机控制器的研制基于单片机的气体测漏仪的研究基于三菱M16C/6N系列单片机的CAN/USB协议转换器基于单片机和DSP的变压器油色谱在线监测技术研究基于单片机的膛壁温度报警系统设计基于AVR单片机的低压无功补偿控制器的设计基于单片机船舶电力推进电机监测系统基于单片机网络的振动信号的采集系统基于单片机的大容量数据存储技术的应用研究基于单片机的叠图机研究与教学方法实践基于单片机嵌入式Web服务器技术的研究及实现\t"_blank
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 学生请假流程告知书
- 物业消杀人员安全生产岗位责任书
- 物业服务满意度调查流程及规范
- DB41-T 2175-2021 水利工程施工企业安全生产风险隐患双重预防体系建设实施指南
- 磅秤卸车过磅协同操作工作手册
- 尿不湿生产芯体复合工艺工作手册
- 书店库存盘点与管控手册
- 运维事件响应与处置工作手册
- 电梯定期检修保养工作手册
- 烟草生产与质量检测手册
- 劳务股东协议书
- 2026浙江湖州市公路水运工程监理咨询有限公司招聘10人笔试参考题库及答案详解
- 湖南省2026年高考招生计划-历史类
- 2026安全生产月事故案例警示教育培训(事故案例截至2026年6月)
- 建筑门窗安装施工方案
- 2026中国功能性食品原料科学认证与消费者认知调研
- 2026年山东能源集团招聘考试指南及模拟题库
- 《危险化学品安全法》与《危化品安全管理条例》条款对照表
- 2025年宁东泰畅水务公司笔试及答案
- 创新课堂教学模式实践方案汇编
- 高处作业吊篮专项施工方案完整版本
评论
0/150
提交评论