The Show Group Page

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.

graphics/22fig06.jpg



ASP. NET Solutions - 24 Case Studies. Best Practices for Developers
ASP. NET Solutions - 24 Case Studies. Best Practices for Developers
ISBN: 321159659
EAN: N/A
Year: 2003
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net