Use the ASP.NET Starter Kit to immediately start Web site development
Release Date: 12/31/2004
| Update Date: 12/31/2004
Paul Litwin
This article assumes that you are familiar with Web development
Download this article: Starterkits.exe (141KB)
Summary
If you want to build an ASP.NET Web site, you need to build on a rugged code basis. Starting from a complete site, make some modifications and custom, then go online, is it great? ASP.NET STARTER KIT is a package solution that allows you to do. These five kits (Community, Reports, Commerce, Portal, and Time Trackers provide full code that can be reused and easy to customize. In addition, there are many ISP support to automatically deploy the ASP.NET STARTER KIT Web site. When you have to make a quick deployment, the task left to you will only have few parts. The author introduced the ASP.NET Starter Kit in this paper, and built a community web site with many advanced features such as evaluation, user vote, upload quotas, changes, and topics.
This page
Commerce Starter Kit and Portal Starter Kittime Tracker Starter Kitreports Starter KitCommunity Starter Kit Create a community Community Starter Kit Structure Using the topic Creating a new module summary
ASP.NET and Visual Studio® .NET have indeed make web applications easier. However, when you create an ASP.NET Web site, you still need to do some work personally. You still need to design a perfect application to develop it with reused reliability, and thoroughly test it. In this process, you may ask yourself: "Is there anyone already solved this problem? Is I repeatedly develop?" Some situations are common for most ASP.NET developers, such as the combination community site, Track the time of a project or create a portal for the company. Based on a foundation with a perfect design (without having to design an application from head design, even if this means you can customize and extend the solution), it will bring a good result. This is the design idea of ASP.NET STARTER KIT.
ASP.NET STARTER KIT is a set of (five) package sample applications provided by Microsoft, you can download from http://www.asp.net/starterkits. These include an e-commerce store application, a community web site, a portal site, a sample report, and a project time tracking application. The purpose of Starter Kit is to provide several useful starting web sites and some reliable ASP.NET code examples, you can learn from them and build a site on this basis. Both all these five Starter Kit come with a complete source code that can be used as a data store and can be used in Visual Basic?, C #, and J # versions. In addition, Starter Kit can be used in the Visual Studio .NET version (with standalone .aspx and code hidden page), Starter Kit can also be used in SDK versions (without code hidden pages). So you can use Starter Kit in your favorite environment, regardless of the environment is Visual Studio .NET, ASP.NET Web Matrix Project, or another editor. In this article, I will introduce these five ASP.NET STARTER KIT. Then, you will focus on the Community Starter Kit to show you how to expand it according to your specific needs. Commerce Starter Kit and Portal Starter Kit
Commerce Starter Kit To create an e-commerce store application for fictional spy company iBuyspy. The app uses a three-layer architecture, cache function, form authentication, and a shopping cart. Commerce Starter Kit also includes a B2B web service component. This is an excellent application for you to study and learn, especially when you need to build your own e-commerce application.
Portal Starter Kit creates a portal app for the fiction spy company IBuyspy described in Commerce Starter Kit. Portal Starter Kit includes 10 portal modules: notifications, contacts, discussions, events, HTML / text, images, links, quick links, XML / XSL, and a custom module.
Back to top
Time Tracker Starter Kit
Time Tracker Starter Kit (see Figure 1) is essentially a time and accounting Intranet application without accounting components. It is quite simple. It has three tabs: log, reports, and administration. The Administration tab can be used to configure the project, the LOG tab can be used to record hours, and the Reports tab can be used to generate a report by item or individual.
Figure 1 LOG tab in Time Tracker Starter Kit
Time Tracker Starter Kit shows many functions of interest, such as three-layer design, Windows?, And Form authentication, using GDI generation dynamic chart and mobile front end.
Back to top
Reports Starter Kit
Reports Starter Kit The difference between other Starter Kit is that it is not a single aggregate application. More correctly, it is a series of (total eight) reports, you can read these reports, run them for sample data and check their source code. In addition, you can copy these source code and paste them into your own application. The toolkit work is similar to ASP.NET QuickStart provided with Microsoft .NET Framework SDK and Visual Studio .NET. These reporting examples include simple table reports, layers of two styles, in-depth reports, crosstabs, and several GDI charts. Back to top
Community Starter Kit
Community Starter Kit may be a core kit. Using it, there is no need to spend too much energy or do not need to know its working principle, you can quickly combine the community site for user groups, clubs, family or communities. It can also be used to combine simple news and information sites. In some respects, it overlaps with the portal Starter Kit, but it is more focused on non-commercial organizations and easier to set up and manage.
Community Starter Kit supports many different types of content, including articles, photo libraries, and event lists. In addition, it also supports a large number of optional features (these features are standard in many community sites), including advertising, arbitration, upload quota, evaluation, review, user vote, content change notification, automatic conversion, theme, web box, Joint, press releases, appearance and security.
The advertisement is processed by two Adrotator controls, and a control has a banner of standard size (468 ã-60 pixels), and the other has a banner with 125 ã-125 pixels. If you enable arbitration functions for an area, the content of this area must be approved by the reviewer to display on this site. You can set up upload quotas for each user to limit the number of images and files that can be uploaded to the site. Community Starter Kit also supports upload quotas for the entire community. This allows ISP many communities that are hosted in a single box, without letting a site take up all disk space available.
You can choose to open user evaluations and comment functions for specific types (such as books or articles). Users can evaluate the content item (rating from 1 to 5), if you prefer, they can also enter comments instead of rating, or add rating and add comments.
Community Starter Kit supports creating and reporting users. Therefore, you can use, "which .NET development language?" Or "What is the original drummer of Zebolin Ship Choos?" And the like of "What is the problem like"? " You can also automatically notify the user when there is new content in an area. You can even specify a conversion function to automatically clear the contamination language from submission content and comments without any intervention.
Community Starter Kit There is an option to allow you to create a topic list in order to require a user to classify the content when adding contribution content. Therefore, the topics of the news site based on .NET Framework can be ASP.NET, managed C , web services, etc.
Community Starter Kit Allows you to add content that you need to highlight in the blank of the page by enabling a variety of web boxes. For example, you can use the web box to display the most popular or newest articles, links, downloads, or photos on the homepage. You can also use the reference web box to display random references on the page.
Community Starter Kit supports copy content: Services subscriptions and web service boxes through two mechanisms. Using the service subscription mechanism, you can aggregate the contents of another Community Starter Kit site area and display it on your site. For example, you can subscribe to another community site discussion area and display it on your own site, as if they are your own discussion area. Like the web box, the web service box displays excerpt information in the blank of the page; however, the web service box can get its content from other sites. You can subscribe to another COMMUNITY STARTER KIT site that will be published as an XML Web service, or subscribed to the RSS service, such as http://msdn.microsoft.com/msdnmag/rss/recent.xml. You can use the XML Web service and the SOAP protocol (rather than the current RSS protocol), any area of the site as a community service. The released area can be used as a service subscription or web service box. You can send a press from the community member. Press Release Components support both templates and embedded special tags, you can use these tags to include fields such as UserName, FullName, and Password, and content specific fields such as NewArticles, Newbooks, and NewDownloads.
The Community Starter Kit Engine supports concepts such as appearance or theme and allows you to completely change the appearance of the site by selecting another topic from the administrative page. The appearance and the theme will be discussed later in this article.
Community Starter Kit supports a wide range of security systems that categorize members by their roles: anonymity, authentication, reviewers and administrators, can also be classified according to your custom role. You can also protect the security of any area of the site so that only specific types of users can view, add, edit, or delete content.
Figure 2 Sample of the Community Web Site
Figure 2 illustrates many community features supported by the Community Starter Kit. The community is a fictional user group called Ballard .NET, which uses Professional theme. Note that the user vote is displayed on the top of the page, the community service supply box title ".NET TIPS & TRICKS" is located in the lower right corner of the page.
Back to top
Create a community
After downloading and installing the Community Starter Kit, the first thing you want to do will be to delete sample sites data. This can be done by clicking the "Login" link at the bottom of the navigation bar and is logged in with the Admin user identity. (Since the password can cause security risks, please change this password as soon as possible.) After successful login, the new link (admin) will appear on the navigation bar. Click the link to jump to the management section of the site, scroll down, find the "delete content" link.
When you return to the community home page after deleting content, you should notice some of the sample content remains. To replace the contents of the home page to your own, you need to return to the management page, click Edit Sections, click the Home area, and provide a site title, description, and logo. You can also use this "Edit Sections" option to change the basic layout of the home page, select a topic, or a number of options to enable the home page (such as a Web box or web service box).
After setting the layout of the home page, multiple areas can be added to the site. A site can have unlimited multiple areas. Figure 3 lists various types of areas (or modules) that can be created.
To add a zone, click the "Edit Sections" link from the management page. You can create multiple types of areas. For example, the community site shown in Figure 2 includes two articles: news and articles. You can use a parent area to help organizations a similar area. For example, if you want to separate the downloads in general classification, you can create a parent area that contains several download areas such as User Controls, Controls, and Speaker Presentations. From the Edit Sections page, you can enable a variety of options for specific areas, such as arbitration or email notifications. You can also choose to publish the content of the area as a community web service.
Back to top
Community Starter Kit Structure
Although many Web sites are driven by data and dynamically generated, most of them are still static. Although this is not necessarily a bad thing, the more dynamically generated on the site, the higher its customization. Community Starter Kit is completely data driver. If you do not calculate the page for site management, the Community Starter Kit contains only a .aspx page with no content. All content is stored in the SQL Server or MSDE database. Community Starter Kit Single Installation Supports multiple communities that can configure the specific ISPAdmin account.
When requesting a Community Starter Kit page to the web server, HttpModule named CommunitiesModule processes the request to determine the community, zone, pages, and users associated with the request, and populate CommunityInfo, SectionInfo, PageInfo, and UserInfo. These objects are members of the Items collection of the Context object. Since the Context object can be saved in all modules and handles involved in a request, these data will be available for page information to process the request (see the "ASP.NET written by Steven Smith" ASP.NET: Nine Options for Managing Persistent User State In Your ASP.NET Application ", published in MSDN? Magazine in April 2003). Then CommunitiesModule redirects the request to the CommunityDefault.aspx page, which is responsible for using the above objects, many user controls, support class, and style sheet dynamically generate responses.
The ready-made Community Starter Kit may not be able to complete everything you want, but the toolkit takes into account scalability when designing. If you don't like its work, you can easily change it. After all, it comes with a full source code written in Visual Basic .NET, C # and J #. The subject and module elements of the toolkit are particularly suitable for customization.
Back to top
Use theme
The Community Starter Kit is based on the ASP.NET Forums application. Like the ForuMS application, it also uses the topic (also known as an appearance) to separate the user interface from the code. The theme is far from the style sheet. In fact, there is no subject, there is no content, which is because the topic contains all controls displayed on the site. The subject consists of the elements listed in Figure 4.
To create a new topic, you need to add a folder below the Communities / Common / Themes folder. The name of the subject derived from the name of the folder. At this folder, create the folder displayed in Figure 4. Fortunately, because all themes are inherited from the basic theme default, you don't have to fill all the folders of the subject. Therefore, if you don't provide the appearance you need to topics, Community Starter Kit will use the exterior of the Default topic. Although the DEFAULT theme contains more than 75 files, you can still create basic topics by providing only a few files. I created a basic topic called Small, which is a streamlined version of the default topic. It is the basic difference from the Default topic that it uses a smaller font, the color is changed to red by blue, and the default page part uses a different layout. My new topic consists of six six files:
• Communities / Common / Themes / Small / Images / redshiny3dsquarebullet_7x7.jpg • Communities / Common / Themes / Small / Skins / ControlSkins / Sections_SectionMenu.ascx • Communities / Common / Themes / Small / Skins / PageSkins / Default.ascx • Communities / Common /THEMES / SMALL/Styles/an_red_arrow.gif • Communities / Common / Themes / Small / Styles / Default.css • Communities / Common / Themes / Small / Styles / RedyellowStar.gif
Of course, the more elements, the theme will be complete. For example, if you go deep into a certain area using the Small subject, a control with a blue background will still be seen. However, if I have not changed the color scheme of this topic, this is the most sensible practice. To create a new theme, the easiest way is to use an existing topic as a model and then modify its appearance and style.
Back to top
Create a new module
Although this is a bit complicated than the creation theme, you can also create a new module for the community. For example, I created a module called Jobs and used it to track job announcements.
To create a new module, add a new table to track the new module item to the CommunityStarterkit database, and name the table as community_module (where Module is the name of the new module). The primary key of the table should be named module_contentpageID, along with the name of other fields to collect by the module.
You will need to add a stored procedure for adding a new module item, editing existing projects, retrieving item list, and retrieving all fields of a single item. Name the stored procedure of the JOBS module as community_jobsaddjob, community_jobseditjob, community_jobsgetjobs, and community_jobsgetjob. I copied the stored procedures for Articles modules, use them as the model of the Jobs stored procedure, and add other fields necessary for tracking work announcements. Community_jobsgetJobs is used to retrieve job lists in the Jobs_SECTION page. This module calls the Community_GetPageDSortedContent function to page the output content (see Figure 5).
Create a new folder that will contain the module code under Engine / Modules. In this folder, there should be three subfolders called Components, Content, and Controls. For the Jobs module, I created Engine / Modules / Jobs / Components, Engine / Modules / Jobs / Content and Engine / Modules / Jobs / Controls Folders. The Components folder should contain two class libraries. The first class library contains classes derived from the ContentInfo class, and the second class library contains a utility class responsible for calling the stored procedures of each module. With the Visual Basic .NET version of the Community Starter Kit, I created a class library called Jobinfo.vb, which contains a single class (JobInfo). I use the Article Info.vb class library as the model of my class library. The Jobinfo constructor uses a single parameter DataReader, extracts each field from the JOBS table through this parameter and puts them in a private variable that will be disclosed as a series of properties of the Jobinfo class (see the code in Figure 6).
The Jobutility class provides interfaces between JOBS modules and JOBS stored procedures, which contain single class Jobutility, which has four methods: addjob, editjob, getjobs, and getjobinfo. The GetJobs method is responsible for calling the community_jobsgetjobs stored procedure and returns ArrayList for the Jobinfo object (see Figure 7).
For each basic type of page supported by the module, the Content folder should contain a class library. These classes will become the code of the user controls created later. At least, your module needs to provide classes for each of the types: Add item, editing item, display item list (for region page) and display a single item (for project deepening pages). These classes need to be derived from ContentAddPage, ContenTEditpage, ContentPage, or ContentItempage. As you may have noticed, Content tends to have a pair of corresponding relationships with the stored procedures they call.
I created four class libraries (addjob.vb, editjob.vb, jobsection.vb, and job.vb), each class library is a model of Articles Content Class. The content class is used to adhere the JobInfo class and the user control appearance. The Job class in the Job.vb class library is responsible for displaying the complete information of a specific work list (see Figure 8).
For each work item displayed on the Job and JobSecion pages, the Controls folder will contain custom server controls. I created the following server controls to Job page: JobCompany, JobTempStatus, JobTempMonths, JobStartDate, JobLocation, JobEducation, JobExperience, JobSalary, JobContactName, JobContactPhone, JobContactEmail, JobContactWeb and JobEditContent. For the JobSecion page, I created the ItemJobLocation control. The JobCompany custom control is displayed in Figure 9.
Now, you need to create some user controls to represent the contents of each basic module page corresponding to the SkinnedCommunityControl class created in the previous step. At least, you must provide a set of content user controls for the Default topic. Content appearance user controls can also be provided for other topics.
I created three user controls under the Themes / Default / Skins / Contentskins folder: jobs_addjob.ascx, jobs_jobsection.ascx, and jobs_job.ascx. There is no user control for editing, because Jobs_AddJob.ascx control executes a double task, which supports adding work and editing. The excerpt of the jobs_job.ascx user control is shown in Figure 10. Note that the reference to the custom server control in the Engine / Modules / Jobs / Controls folder is a custom server control of JobCompany and JobTemPstatus.
At this point, I add a style to the default style sheet for the new content control. The style. Figure 11 shows several new styles thereof.
Finally, I added an entry for the item and the project area page to the community_pagetypes table in the database. This step is relatively simple with the stored procedure created by the existing Community_MaintenAnceInitialIzeArticles stored procedure. Running this stored procedure creates the necessary table entry.
Figure 12 JobSECTION page
Figure 12 shows the JobSecion page of the Ballard .NET community site. If you click the "Read More" link below the work announcement, the JOB page shown in Figure 13 will be displayed.
Figure 13 JOB Page
The link address that is starting in this article is downloaded to form a file copy of the JOBS module (and the SMALL topic).
Back to top
summary
ASP.NET Starter Kit offers several pre-packaged sample applications that provide both WEB site templates that can work properly, and provide easy-to-use sample code written in Visual Basic .NET, C # and J #. These kits represent the most common web applications, including communities, business, portals, reports, and project time tracking sites. This article discusses the installation and use of Starter Kit, as well as customization and expansion of the COMMUNITY STARTER KIT by code (even if you don't have Visual Studio .NET copy). If you seek ways to start creating an ASP.NET site instantly, these kits may be a set of convenient tools you are looking for. It is also important to note that individuals who provide Web hosting companies provide automatic deployment of Starter Kit and account registration. For more information, see http://www.asp.net/hosters.
Thank Stephen Walther Help I write this article.
For background information, see: ASP.NET Starter Kitshttp: //msdn.microsoft.com/aspnet
Paul Litwin is a CEO and senior trainer of Deep Training, which is mainly engaged in .NET training. He is the chairman of the meeting of Microsoft ASP.NET Connections, and he personally writes or with people with many books, including ASP.NET For Developers (SAMS, 2001). He is currently writing a new book about ASP.NET. You can contact Paul to contact Paul@deeptraining.com.
Go to the original English page
Back to top