There will be times when you want a group to be displayed by itself. Examples of this would be when you want to offer all files for a certain application, and when you don't want users to have to log in and enter search criteria. Listing 22.10 contains the code for the Show Group page (ShowGroup.aspx). You can see the page in operation in Figure 22.6. Listing 22.10 This Code Is Behind the ShowGroup.aspx Page.private void Page_Load(object sender, System.EventArgs e) { if( !IsPostBack ) { // Create a connection object. SqlConnection objConnection = new SqlConnection(ConfigurationSettings.AppSettings["ConnectString"]); try { // Open the connection. objConnection.Open(); string strGroupID = Request.QueryString["ID"]; if( strGroupID == null ) { strGroupID = "-1"; } string strDirectory = ConfigurationSettings.AppSettings["DirectoryName"]; string strSql = "Select Title,Version,Description,Filesize,Filepath=('" + strDirectory + "'+Directory+'/'+Filename) from FileInfo " + "where Group"]; if( strGroupName == null ) { strGroupName = ""; } Response.Write( strGroupName ); } Figure 22.6. All of Your Groups and Their Files Will Be Shown in This Page. |