Use ASP. NET Starter Kit to start Web site development immediately

Source: Internet
Author: User
Tags hosting companies web hosting web hosting companies
Use ASP. Net starter kit to start Web site development now. Release Date: 12/31/2004 | updated on: 12/31/2004

Paul litwin

This document assumes that you are familiar with Web Development

Download the code in this article:StarterKits.exe(141kb)

Summary

If you want to build an ASP. NET Web site, you need to build it based on robust and reliable code. Is it great to make some changes and customize them from a complete website and then launch them online? ASP. NET Starter Kit is a packaging solution that allows you to do so. The five Toolkit (Community, Reports, Commerce, Portal, and Time Tracker) provide reusable and customizable complete code. In addition, many ISPs Support automatic deployment of ASP. NET Starter Kit Web sites. When you must deploy the site quickly, only a few tasks are left for you. This article introduces ASP. NET Starter Kit and builds a community Web site with many advanced features (such as rating, user voting, uploading quotas, change notifications, and topics.

Content on this page
Commerce starter kit and portal Starter Kit
Time tracker Starter Kit
Reports Starter Kit
Community Starter Kit
Create a community
Community Starter Kit Structure
Topic
Create a new module
Summary

ASP. NET and Visual Studio. NET have indeed made Web application development easier. However, you still need to do some work yourself when creating an ASP. NET Web site. You still need to design a complete application, develop it with reusable reliable code, and thoroughly test it. In this process, you may ask yourself: "has someone already solved this problem? Are I developing it again ?" Some scenarios are common for most ASP. NET developers, such as combining community sites, tracking the time of a project or creating portals for a company. Building Based on a well-designed Foundation (without having to design the application from scratch, even if it means you can customize and scale the solution) will bring good results. This is exactly the design idea of ASP. NET Starter Kit.

ASP. NET Starter Kit is a set of five sample packaging applications provided by Microsoft that you can download from the http://www.asp.net/starterkits. This includes an e-commerce storefront application, a Community Web site, a portal site, sample reports, and a project time tracking application. The purpose of Starter Kit is to provide several useful start websites and some reliable ASP. NET code examples, from which you can learn and build websites. All the five Starter Kit comes with the complete source code? Or Microsoft? The Data Engine (MSDE) is used for data storage and can be stored in Visual Basic? C # And J # versions. In addition, Starter Kit can be used in Visual Studio. NET (with independent. aspx and code hidden pages) or in SDK version (without code hidden pages. Therefore, you can use Starter Kit in your favorite environment, regardless of whether 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. Next, we will focus on Community Starter Kit to show you how to expand it based on your specific needs.

Commerce starter kit and portal Starter Kit

Commerce Starter Kit needs to create an e-Commerce storefront application for the fictitious spyware company IBuySpy. The application uses a three-tier architecture, cache function, form authentication, and a shopping cart. Commerce Starter Kit also includes a B2B Web service component. This is a great application for you to study and learn, especially when you need to build your own e-commerce applications.

Portal Starter Kit creates Portal applications for the fictitious spyware IBuySpy described in Commerce Starter Kit. Portal Starter Kit consists of 10 Portal modules: notification, contact, discussion, event, html/text, image, Link, quick link, 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 a accounting component. It is quite simple. It has three tabs: log, reports, and administration. The Administration tab can be used to configure projects, the Log Tab can be used to record hours, and the reports tab can be used to generate reports by project or individual.

Figure 1 Log tab in time tracker Starter Kit

Time tracker starter kit shows many interesting ASP. NET architecture features, such as three-tier design, windows? And form authentication, use GDI + to generate dynamic charts, and move the front-end.

Back to Top

Reports Starter Kit

The difference between reports starter kit and other starter kit is that it is not a single aggregate application. More correctly, it is a series of (eight in total) reports that you can read, run them for the sample data, and check their source code. In addition, you can copy the source code and paste it into your own application. This toolkit works in a way similar to ASP. NET Quickstart provided with Microsoft. NET Framework SDK and Visual Studio. NET. These Report examples include simple table reports, two types of hierarchical and in-depth reports, cross tables, and several GDI + charts.

Back to Top

Community Starter Kit

Community Starter Kit may be the core toolkit. With it, you can quickly combine community sites for user groups, clubs, families, or communities without having to know how it works. You can also use it to combine simple news and information sites. In some respects, it overlaps with the functions provided by portal starter kit, but it focuses more on non-commercial organizations and is easier to set and manage.

Community Starter Kit supports many different types of content, including articles, photo repositories, and event lists. In addition, it supports a large number of optional features (these features are standard on many community sites ), these include advertising, arbitration, uploading quota, rating, comments, user voting, content change notification, automatic conversion, subject, Web box, union, Press Release, appearance and security.

An advertisement is handled by two AdRotator controls, one with a standard size (468 pixel-60 pixel) and the other with a 125 pixel-125 pixel. If you enable the arbitration function for a region, the content of this region must be approved by the reviewer to be displayed on this site. You can set an upload quota for each user to limit the number of images and files that can be uploaded to the site. Community Starter Kit also supports the uploading quota for the entire Community. This allows the ISP to host many communities in a single box without occupying all available disk space for a site.

You can choose to enable the user rating and comment function for a specific type of content (book or article. Users can evaluate content items (the rating can be from 1 to 5). If they want to, they can also enter a comment to replace the rating, or both add a rating and a comment.

Community Starter Kit supports creating and reporting user voting. Therefore, you can use a development language such as "Which one do you like for. NET ?" Or "what is the name of the first drummer of the Qi Yi spacecraft choir ?" And so on. You can also automatically notify users when there is new content in a region. You can even specify the Conversion Function to automatically clear the foul language from the submitted content and comments without any intervention.

Community Starter Kit has an option that allows you to create a topic list so that you can classify the content when adding the contributed content. Therefore, the topics of. NET Framework-based news sites can be ASP. NET, hosted C ++, and Web services.

Community Starter Kit allows you to enable various Web boxes to add content to be highlighted in the blank area of the page. For example, you can use a Web box to display the most popular or up-to-date articles, links, downloads, or photos on the home page. You can also use the reference Web box to display random references on the page.

Community Starter Kit supports two mechanisms for copying content: Service subscription and Web Service boxes. By using the service subscription mechanism, you can aggregate the content of another Community Starter Kit site region and display it on your site. For example, you can subscribe to the discussion area of another community site and display it on your own site as if they were your own discussion area. Like a Web box, the Web service box displays extracted information in the blank area. However, the Web service box can obtain content from other sites. You can subscribe to another Community Starter Kit site that uses its content as an XML Web Service, or subscribe to RSS services such as http://msdn.microsoft.com/msdnmag/rss/recent.xml. You can use the XML Web Service and SOAP protocol (instead of the current RSS Protocol) to publish any region of the site as a community service. The published region can be used as a service subscription or Web service box.

You can send press releases to community members. The press release component supports 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 appearance, themes, and other concepts, and allows you to completely change the appearance of a site by selecting another topic from the Management page. The appearance and topic will be discussed later in this article.

Community Starter Kit supports a wide range of security systems that classify members by their roles: Anonymous, authenticated, reviewed, and administrator, you can also classify roles according to your custom roles. You can also protect the security of any area of the site so that only a specific type of users can view, add, edit, or delete content.

Figure 2 community Web site example

Figure 2 illustrates many Community functions supported by Community Starter Kit. This community is a fictitious user group Named Ballard. NET, which uses a Professional topic. Note that the user vote is displayed on the top of the page, and the community service supply box title ". NET Tips & Tricks" is located in the bottom right corner of the page.

Back to Top

Create a community

After downloading and installing Community Starter Kit, the first thing you want to do is to delete the sample site data. You can click the "Login" link at the bottom of the navigation bar and log on with the Admin password as the Admin user. (Because this password may cause security risks, please change it as soon as possible .) After successful logon, the new link (Admin) will appear on the navigation bar. Click the link to go to the management section of the site. scroll down to find the "Delete Content" link.

When the content is deleted and returned to the community homepage, you will notice that some sample content is retained. To replace the homepage content with your own content, go back 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 enable many optional features of the home page (such as displaying Web boxes or Web service boxes ).

After setting the homepage layout, you can add multiple regions to the site. A site can have unlimited regions.Figure 3Lists various types of zones (or modules) that can be created ).

To add a region, click the "Edit Sections" link on the Management page. You can create multiple regions of the same type. For example, the community site shown in Figure 2 contains two Article regions: News and Articles. You can use the parent region to help organize a group of similar areas. For example, if you want to separate the downloaded content by general categories, you can create a parent region that contains several download regions (such as User Contributions, Controls, and Speaker Presentations.

On the Edit sessions page, you can enable various optional features for a specific region, such as arbitration or email notification. You can also choose to publish the content of this region as a Community Web service.

Back to Top

Community Starter Kit Structure

Although many Web sites are data-driven and dynamically generated, most of them are still static to a large extent. Although this is not necessarily a bad thing, the more content dynamically generated on the site, the higher the customization level. Community Starter Kit is completely data-driven. If the page for site management is not calculated, Community Starter Kit only contains a. aspx page with no content. All content is stored in SQL Server or MSDE database. The single installation of Community Starter Kit supports multiple communities that can be configured with special ISPAdmin accounts.

When you request a Community Starter Kit page from the Web server, an HTTPModule named CommunitiesModule processes the request and determines the communities, regions, pages, and users associated with the request, and fill in the CommunityInfo, SectionInfo, PageInfo, and UserInfo objects respectively. These objects are members of the Items set of the Context object. Because the Context object can be saved in all modules and handlers involved in a request, the data will be available for pages that process the request (for more details about the Context object, see ASP. NET: Nine Options for Managing Persistent User State in Your ASP. NET ApplicationMSDN?Magazine). The CommunitiesModule then redirects the request to the communityDefault. aspx page, which dynamically generates responses using the above objects, many user controls, support classes, and style sheets.

The ready-made Community Starter Kit may not be able to do everything you want, but it is designed with Scalability considerations. If you don't like how it works, you can easily change it. After all, it comes with the complete source code written in Visual Basic. NET, C #, and J. The theme and module elements of this toolkit are particularly suitable for customization.

Back to Top

Topic

The Community Starter Kit is designed based on the ASP. NET Forums application. Like the Forums application, it also uses themes (also known as appearances) to separate the user interface from the code. A topic is far more than a style table. In fact, there will be no content without a topic, because the topic contains all the controls displayed on the site. SubjectFigure 4.

To create a topic, add a folder under the Communities/Common/Themes folder. The topic name is derived from the name of the folder. Under this folder, createFigure 4. Fortunately, because all themes are inherited from the basic theme Default, you do not have to fill in all folders of the theme. Therefore, if you do not provide the appearance required by the topic, Community Starter Kit uses the Default topic appearance.

Although the Default topic contains more than 75 files, you can create a basic topic by providing only a few files. I created a basic topic named Small, which is a simplified version of the Default topic. The basic difference between it and the Default theme is that it uses a smaller font, the color is changed from blue to red, and the tabs adopt different la S. My new topic consists of the following 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 provided, the more complete the topic. For example, if you go deep into a region using the Small topic, you will still see the control with a blue background. However, if I have not changed the color scheme of the topic, this is the best practice. To create a new topic, you can use the existing topic as the model and modify its appearance and style.

Back to Top

Create a new module

Although this is a bit more complex than creating a topic, you can also create a new module for the community. For example, I created a module named Jobs to track work announcements.

To create a new module, first Add a new table to the CommunityStarterKit database to track new module items, and name the table Community _Module(Where,ModuleIs the name of the new module ). The primary key of the table should be namedModule_ ContentPageID, together with the names of other fields to be collected for this module.

You will need to use the stored procedure to add new module items, edit existing projects, retrieve the project list, and then retrieve all fields of a single project. Name the stored procedures of the jobs module community_jobsaddjob, community_jobseditjob, community_jobsgetjobs, and community_jobsgetjob. I copied the stored procedures of the articles module, used them as models of the jobs stored procedures, and added other fields necessary for tracking work announcements. Community_jobsgetjobs is used to retrieve the job list on the jobs_section page. This module calls the community_getpagedsortedcontent function to page the output content (seeFigure 5).

Create a new folder under engine/modules that will contain the code of this module. In this folder, there should be three subfolders named 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 Utility Classes that call the stored procedure of each module.

Using Community Starter Kit of Visual Basic. net, I created a class library named jobinfo. VB, which contains a single class (jobinfo ). I use the articleinfo. VB class library as the model of my class library. The jobinfo constructor uses the single parameter datareader to extract each field from the jobs table and put them into a private variable that will then be exposed as a series of attributes of the jobinfo class (seeFigure 6).

The JobUtility class provides interfaces between the Jobs module and the Jobs stored procedure, including a single class of JobUtility, which has four methods: AddJob, EditJob, GetJobs, and GetJobInfo. The GetJobs method calls the Community_JobsGetJobs stored procedure and returns the ArrayList of the JobInfo object (seeFigure 7).

For each basic page supported by this module, the Content folder should contain a class library. These classes will be the code of the user control created in the future. At least, your module needs to provide classes for each of the following types of pages: Add a project, edit a project, display a project list (for a region page), and display a single project (for a project deepening page ). These classes must be derived from ContentAddPage, ContentEditPage, ContentListPage, or ContentItemPage. As you may have noticed, Content often has a one-to-one relationship with the stored procedures they call.

I have created four class libraries (AddJob. vb, EditJob. vb, JobSection. vb, and Job. vb). Each class library uses the Articles content class library as the model. The content class is used to adhere to the JobInfo class and user control appearance. The Job class in the Job. vb class library displays the complete information of a specific work list (seeFigure 8).

For each work item displayed on the Job and JobSection pages, the Controls folder contains custom server Controls. I created the following server controls for the Job page: JobCompany, JobTempStatus, region, JobStartDate, JobLocation, JobEducation, region, JobSalary, JobContactName, JobContactPhone, region, JobContactWeb, and JobEditContent. For the JobSection page, I created the ItemJobLocation control. The JobCompany custom control is displayed inFigure 9.

Now, you need to create some user controls to show the appearance of each basic module page corresponding to the skinnedcommunitycontrol class created in the previous step. At least, you must provide a set of content appearance user controls for the default topic. You can also provide content appearance user controls for other themes.

I created three user controls in the themes/default/skins/contentskins Folder: jobs_addjob.ascx, jobs_jobsection.ascx, and jobs_job.ascx. There is no user control for editing work. This is because the jobs_addjob.ascx Control performs a dual task and supports both adding and editing work.Figure 10The Excerpt from the jobs_job.ascx user control is displayed. Note the reference of the custom Server Control named jobcompany and jobtempstatus in the engine/modules/jobs/controls folder.

Now, I have added a style to the new content control's default style table (themes/theme/styles/default.css.Figure 11Displays several new styles.

Finally, I added entries for this project and project region pages to the community_pagetypes and community_namedpages tables in the database. By imitating the stored procedure created by the existing community_maintenanceinitializearticles Stored Procedure named community _ maintenanceinitializejobs, this step is relatively simple. Running this stored procedure creates necessary table entries.

Figure 12 jobsection page

Figure 12 shows the jobsection page of the Ballard. Net community site. If you click the "Read More" Link under the Work announcement, the job page shown in 13 is displayed.

Figure 13 job page

Download a copy of the files that constitute the jobs module (and the small topic) from the link at the beginning of this article.

Back to Top

Summary

ASP. NET Starter Kit provides several pre-packaged sample applications, which provide both a working Web site template and Visual Basic.. NET, C #, and J. These toolkit represents the most common Web applications, including communities, businesses, portals, reports, and project time tracking sites. This article discusses how to install and use Starter Kit, and how to customize and extend Community Starter Kit through code (even if you do not have a copy of Visual Studio. NET. If you are looking for a way to create an ASP. NET site immediately, these toolkit may be a set of convenient tools you are looking. Note that some Web hosting companies can automatically deploy Starter Kit and register their accounts. For more information, see http://www.asp.net/hosters.

Thanks to Stephen Walther for helping me write this article.

For background information, see:
ASP. NET Starter Kits
Http://msdn.microsoft.com/aspnet

Paul litwinAs CEO and senior trainer of Deep Training, the company is mainly engaged in. NET Training. He is the chairman of the Microsoft ASP. NET Connections conference. He has written or written many books with others, includingASP.Net for developers(SAMS, 2001 ). He is currently writing a new book on ASP. NET. You can usePaull@deeptraining.comContact Paul.

Go to the original English page


Back to Top
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.