Create your first SharePoint 2010 application

Source: Internet
Author: User
Tags visual studio 2010

To create your first SharePoint 2010 application in this article, you will learn: 1. Create a solution that reads and writes list data using the server-side object model and Visual Web Part parts. 2. Create and deploy the solution using Visual Studio 2010. 3. Use the chart Web part to render the list data. 4. The different Visual Web Parts in a Web Part Page integration solution. Final effect: Prepare: First create two necessary lists for customer sales and total sales. The first list stores information about the company and FY10 quarterly sales. It contains a company column (a single line of text, modified by the title bar) and four columns Q1,q2,q3,q4 (single line of text), like this: The second list consists of two columns. Year (single-line text) and sales (number). Like this: Create an application: A total of four steps. First develop a add record to Customer Sales listThe function. Create a blank solution that provides the project framework. 1. Open Visual Studio 2010.2. Click File-Create a new project. 3. Navigate to a different project type and select the visual Studio solution. 4. Click on the Blank solution and name myfirstspsolution. Add a record to the sales list the primary interface is a Visual Web Part. 1. Right-click the solution and choose Add-New project. 2. Select the blank SharePoint project, name Customersaleswebpart, and click OK. Deployed as a farm solution. 3. Right-click the project, select Add-New Item-Visual Web Part, name CUSTSALESVWP. 4. Right-click Custsalesvwp.ascx and select View Viewer. 5. Create the following interface with 6 tabs, 5 text boxes, and 2 link buttons. The code should look like this:  6. Right-click Custsalesvwp.ascx and click View Code to switch to Code view. 7. Add reference using Microsoft.sharepoint;8. The final code should look like this:  9. Deploy the solution. 10. On the SharePoint site, create a new Web Part Page. Click on all site Content-Create-page--web part Page. Name Sales Dashboard. 11. Add the Web Part and find the CUSTSALESVWP in the custom class. Click Add. Test this Visual Web Part to make sure it works correctly. Add a new record to the customer sales list and go to verify. Click Add to view the list: Click Clear, Data empty: View Customer sales data Next we will create a read-only Web Part that simply loads and displays the data in the Customer sales list. In an ASP. NET application, the data grid is a very efficient way. This time we'll use this feature to load and refresh the data. 1. FILE--New--project. 2. Select the blank SharePoint project and name Customersaleslist. Click Add to Solution. 3. Deploy as a farm solution. Click Done. 4. Right-click the project and select Add-new item. 5. Select the Visual Web Part, name SALESVWP, and click Add. 6. Right-click Salesvwp.ascx and select View Viewer. 7. Drag 2 tabs, a DataGrid, a link button, and an update Panel. The final code should be such that the:  interface is this: 8. Right-click the project, add--class, name customerSales. Add part of the code:  9. Right-click Salesvwp.ascx and select View Code. 10. Add part of the code, and finally this is:  11. Right-click the project, select Build solution, and deploy the solution after success. 12. On the previous page, click Site Actions-Edit page-Add Web Part. 13. Select the SALESVWP Web Part in the custom class. Click Add. 14. You can see: When you click Load, you see: View total sales to create a consolidated sales Web Part. 1. Right-click on the solution, add-new project. 2. Select the blank SharePoint project, name Totalsalesvisualwebpart, click OK, and deploy as a farm solution. 3. Right-click the project, add-New item, select Visual Web Part, name TOTALSALESVWP, click Add. 4. Drag 2 tabs, a DataGrid, and a link button. The final code view is this:  5. Right-click the project, add-class, name Salestotals.  6. Right-click the project and select View Code. 7. Add the code, and the last thing is this:  8. Right-click the project and select Build. Deploy the solution after success. 9. Add the Web Part on the same page. 10. Find TOTALSALESVWP in the custom class and click Add. 11. You will see: After clicking Load: Add a Chart Chart Web part to render the data for the total sales list in the view of the graph. 1. Edit the previous page. 2. Add a Web Part. In the Business data class, select the chart Web part and click Add. 3. Click Edit this Web Part to customize your chart. 4. The first step is to select a column chart. 5. Receive the default of the second step. 6. Third step, check the display chart title. Name FY ten Sales. Click Auto Preview to view the chart layout. Click Done. 7. Right-click the Web Part drop-down arrow and select Connect to data. 8. Select Connect to list and click Next. 9. Select the TotalSales list and click Next. 10. You will see a table layout and click Next. 11. This step you can set the custom change icon appearance, here receive the default, x field select Sales, click Done. On the page you will see: The final Complete page is like this:

Create your first SharePoint 2010 application

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.