Webmatrix tutorial (3) (Follow Microsoft's latest weapon: Create Your webmatrix Website Based on blank projects [Part 2])

Source: Internet
Author: User
Tags compact
Document directory
  • Test your site
  • Use Database
  • Optimize your website
  • Release
Test your site

Webmatrix contains an IIS express which works much like IIS. However, IIS Express is integrated in webmatrix and runs on a local computer, which facilitates local testing.

Sometimes you need not only to check the appearance of the webpage, but you may want to know what happened in the background data exchange. For example, if there is any corrupted link, webmatrix has a tool that can take you directly to such files for correction.

SelectSiteWorkspace, and thenRequestsYou can see in the functional areaRequestsTool, and then clickOnly errorsOnly check for errors.

The first two examples show the 404.0 error code because your website does not have the required icon. To view details about the error, click the line to enter. Webmatrix will show you information about this error-this webpage contains invalid links.

Use Database

Many websites need to save information to the database. Webmatrix contains Microsoft SQL Server compact 4.0. You can use it to create the required website database. With SQL Server compact, you can easily publish a website because all data is stored in your website folder. (If your website traffic increases, you need more database functions. webmatrix can automatically migrate data to a later version of SQL Server .)

Whether you use SQL Server compact or full SQL Server, you can use webmatrix to create a database, tables and columns, and add and display data. To learn how to use a database, switchDatabasesWorkspace. Click a database to addNew Database.

Next, create a table and define some columns for it. In the Navigation Pane, clickTablesAnd then clickNew tableCreate a table on the functional area. ClickNew ColumnAdd columns in the table. Add the following lines:

ClickSaveIcon in the toolbar quick access and name the tableProduct.

Next, select the new table in the Navigation Pane. In the functional area, clickDataUse the data editor in the built-in table to add some data:

Well, you have obtained some data... How do you display it now? Easy. Use another ASP. NET helper, webgrid helper. In the files workspace, create another cshtmlListproducts. cshtmlAdd the following code:

@{

VaR DB = database. Open ("webmatrixdemo ");

VaR grid = new webgrid (db. Query ("select * from product order by name "));

}

<! Doctype HTML>

<HTML>

<Head>

<Title> Products </title>

<Style type = "text/CSS">

Table {border-collapse: collapse ;}

TD, Th {border: solid 1px ;}

</Style>

</Head>

<Body>

<H1> Products

@ Grid. gethtml ()

</Body>

</Html>

SelectListproducts. cshtmlAnd then clickRun. The browser displays a sortable:

Optimize your website

Webmatrix has a built-in search engine optimization (SEO) tool to check websites and provide suggestions to help increase the ranking of your websites. This tool shows the areas you can optimize and points out the relevant web pages. To create a report, selectReportsWorkspace, and then clickRun an SEO report for your site. This report lists the detected errors.

We can double-click the URL of localhost to expand it to see what the problem is.

For each error, webmatrix describes the problem. We recommend a solution and provide a detailed link. At this point, you can click Edit this page, which will go directly to the editing page, where you can solve the problem or get more information.

Release

To publish a website, webmatrix has a built-in solution that supports FTP and Microsoft Web deployment. This is a one-click release. Once you have set the hosting information, you can directlyReleaseWebsite. Very simple!

Pending

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.