Scott Mitchell has written another fantastic article on the simple and clean implementation of providing the check/uncheck all functionality in the GridView control.
The only thing his implementation missing in the article is placing CheckBox in the header of the GridView, and using it to toggle rows CheckBoxes. I made a small modification to the existing code to add this feature:
ProtectedSubPage_Load(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesMe.LoadIfNotPage.IsPostBackThenDimdirInfoAsNewDirectoryInfo(Request.PhysicalApplicationPath)FileList.DataSource=dirInfo.GetFiles()FileList.DataBind()EndIf'On every page visit we need to build up the CheckBoxIDs array
ForEachgvrAsGridViewRowInFileList.Rows'Get a programmatic reference to the CheckBox control
DimcbAsCheckBox=CType(gvr.FindControl("RowLevelCheckBox"),CheckBox)ClientScript.RegisterArrayDeclaration("CheckBoxIDs",String.Concat("'",cb.ClientID,"'"))Next'--modified code
DimcheckAllAsNewCheckBox()checkAll.Text=""checkAll.ID="checkAll"checkAll.Attributes.Add("onclick","ChangeAllCheckBoxStates(this.checked);")FileList.HeaderRow.Cells(0).Controls.Add(checkAll)EndSub
Sahil has posted some old tricks of using those old DOS commands. Some of the command tricks are really handy, but my favorite one will always remain the same, which is:
K. Scott Allen has written two great articles on using Master Page in ASP.NET. Through these articles Scott tried to address some of the common problems usually faced by developers.
Here is a useful .NET utility tool if you just want to do quick test your code and without requiring to launch VS.NET and creating a new project setup.
NAnt is a powerful scripting tool designed for developers, software process engineers, and build specialists to create an automated, repeatable process for building their developed application. NAnt provides powerful XML-based scripting and some really cool features, as Jean-Paul Boodhoo explains in his series of post “Automating Your Builds With NAnt”, which can streamline your development and unit testing effort dramatically.