Web hosting forums || get your web hosting related questions answered https://www.hostasp.net/forums/tags/webmatrix-deployment.html 2024-05-03T11:20:00+00:00 Joomla! - Open Source Content Management How to publish a web application using WebMatrix Web Deploy 2011-09-25T19:57:32+00:00 2011-09-25T19:57:32+00:00 https://www.hostasp.net/forums/question/how-to-publish-a-web-application-using-webmatrix-web-deploy.html Jacob [b]To run the steps in this procedure you must be running Windows XP SP3 or a later version of Windows. You'll also need to have WebMatrix installed. Please see here for installation WebMatrix [url=http://www.hostasp.net/forums/question/getting-started-with-webmatrix-part-1-webmatrix-installation.html]Installing WebMatrix[/url][/b] [b]Just follow the simple steps below for setting up your website and WebMatrix IDE[/b] [b]How it works: [/b] After you create a website locally, you would typically publish the website to your [b]Web hosting Space[/b]. Publishing your website involves following steps: Step 1: Preparing your Web Hosting Space Step 2: Configuring WebMatrix for Publishing Step 3: Publishing Step 4: Review Site [b]Web hosting Space[/b] When you publish your website, you copy files from your computer to a web server that's maintained by HostASP. That can be done by two ways Web Deploy method and FTP method. We support both Web Deploy and FTP method to automate the publishing process. FTP method lets you publish Microsoft SQL Server Compact 4.0 databases, but not databases that use SQL Server or SQL Server Express. Among the publishing options is SSL, which stands for secure sockets layer. (SSL is what you're using if you access a Web site using https:// instead of http://.) SSL encrypts the information going between the browser and server, and is a good idea for pages that involve private information like passwords and credit-card numbers. Setting up SSL requires extra steps like purchasing and configuring a certificate that's used for encryption. At HostASP, we offer Free SSL publishing URL when you do Web Deploy all your files are encrypted, safely and securely transferred to your HostASP Web hosting account. [b]Databases[/b] If you're using SQL Server Compact as your database, the data is stored in an .sdf file. When you publish the database, WebMatrix copies not only the .sdf file but also the database program itself to the web server. This ensures that the published site will work even if SQL Server Compact isn't already installed on the web server. If you're using a SQL Server or MySQL database, WebMatrix publishes the database by creating scripts that run in a database that has been created for you by your hosting provider. These scripts create database tables and insert data into them in order to replicate the structure and data that you have in the database on your computer. If you're using a SQL Server Compact database and want to publish to a SQL Server database, you must migrate the data to SQL Server before publishing. For instructions, see Migrate a database to SQL Server. You might want to do this to take advantage of SQL Server features such as stored procedures and its additional capabilities, such as handling more than 256 concurrent connections or creating databases larger than 4 gigabytes In this session we will see how to deploy our movies website, we earlier saw in other topic how to develop a simple movies website using MS SQL Compact DB. We will now deploy this website to our web hosting account on domain name http://www.yourwebhosting.in/ [b]Step 1: Preparing your Web Hosting Space[/b] Very first step that you would need to do is prepare your website for web publishing on our web hosting space. Login to your web hosting control panel, open website properties and setup a web deploy account ( this will create a windows NT account ). Use this account to configure the Publishing XML. This will enable your website for remote Website publishing. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-enabling-web-deployment_03.png[/img] To setup an web deploy account - Provide user name and password for your Web publishing and click on enable button. This will enable your web deployment account for web publishing. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-webdeploy-account_03.png[/img] You could see Web publishing is now enabled on your account. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-webpublishing-enabled_03.png[/img] You do have option to configure Web publishing XML - If you have multiple databases on your web hosting account and based on your application database type, you could choose a MS SQL database or My SQL database, The database user whom permission is granted and then the FTP account. Select your choice and rebuild the publishing XML. After rebuild is complete your publishing XML is saved and can be downloaded onto your local machine for import to WebMatrix. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-publishingsettings_03.png[/img] [b]Step 2: Configuring WebMatrix for Publishing[/b] Now that we configured our web hosting account for Web publishing, let us download the publishing XML file. The file that you download will have .publishsettings as extension , here in our case we will have yourwebhosting.in.publishsettings. Find below the structure of publishing XML file. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-publishingxml_02.png[/img] Now go to WebMatrix IDE on Top Menu -> Publish -> Settings and Import the file by clicking on "Import Publish Settings" this would default all the required fields with server information that you have on Publishing XML. Publishing XML supports both FTP method and Web deploy method. Let us see deployment using Web Deploy method. You would also notice that server name with https prefix, we have setup this URL with SSL certificate so that you can safely deploy your website over internet. One more thing you would notice is "Remote connection string not required" against this Movies DB it is because this MoviesDB application uses integrated SQL Compact Databases .SDF and so you would not require an explict or external MS SQL Server access on your hosting account, if your web application uses MSSQL or MySQL server then it would be filled in with information by default from Publishing XML. Ok, now that you have imported the settings lets Click on validate settings to connect to the server. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-import-publishingxml_03.png[/img] You have done your validation part and is successful, the information you have got on Publish setting is fine and able to connect to server. Click on save button to save this setting on your project. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-publishing-validatesettings_03.png[/img] [b]Step 3: Publishing[/b] You are done with the server validation part, let us now start publishing website. Click on Publish. This will perform compatibility check with the server to see you web application is compatible with the server / web hosting account. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-publish-compatibilitysettings_03.png[/img] Accept and proceed with compatibility check with the server. WebMatrix will upload few sample / test files to the server to check the server requirement for your website. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-compatibilitychecking-uploadingfiles_03.png[/img] You would then see WebMatrix validating the server requirement, for this MoviesDB website you would need ASP.NET setup and support for simple HTML on server. It is validated and WebMatrix found them available on our Web hosting account. Click on Continue to proceed with deployment. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-publish-compatibility-results_03.png[/img] The Publish Preview dialog box appears. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-publish-preview_03.png[/img] Review the list of files and databases and make changes if necessary. For example, you might want to clear check boxes under Changed Files to exclude some files. [quote]Important: If you're publishing a database and the database already exists in the hosting provider's site, whatever is in that database will be overwritten. [/quote] Click Continue. WebMatrix publishes the website, showing status messages in the navigation bar at the bottom of the screen. The publishing process is done in the background, which means you can continue to work in WebMatrix while it is publishing. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-publishing-yourwebhosting_02.png[/img] In the notification bar at the bottom of the screen, you can click Log to see a detailed log of the publishing activity. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-deployment-log_03.png[/img] If you see something in the log that catches your attention during the publishing process, you can click Pause Scroll to go back and examine what you saw more carefully. When the publishing process is complete, the notification bar lets you know: [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-publishing-complete_02.png[/img] [b]Step 4: Review Site[/b] To verify that publishing was successful, browse to the site. If you published a database, make sure you try any pages that display data from the database. [quote]Note: If your site has a Web.config file, the copy on your web hosting account on web server might look slightly different. For example, if you published a SQL Server database, it will have the our web hosting SQL connection string value so that the published site will use the database at the hosting provider.[/quote] [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-review-websites_03.png[/img] In the next Topic we will show how to download [b]DotNetNuke[/b] using WebMatrix Gallery, and set them up locally, test and then deploy remotely on a server. [b]To run the steps in this procedure you must be running Windows XP SP3 or a later version of Windows. You'll also need to have WebMatrix installed. Please see here for installation WebMatrix [url=http://www.hostasp.net/forums/question/getting-started-with-webmatrix-part-1-webmatrix-installation.html]Installing WebMatrix[/url][/b] [b]Just follow the simple steps below for setting up your website and WebMatrix IDE[/b] [b]How it works: [/b] After you create a website locally, you would typically publish the website to your [b]Web hosting Space[/b]. Publishing your website involves following steps: Step 1: Preparing your Web Hosting Space Step 2: Configuring WebMatrix for Publishing Step 3: Publishing Step 4: Review Site [b]Web hosting Space[/b] When you publish your website, you copy files from your computer to a web server that's maintained by HostASP. That can be done by two ways Web Deploy method and FTP method. We support both Web Deploy and FTP method to automate the publishing process. FTP method lets you publish Microsoft SQL Server Compact 4.0 databases, but not databases that use SQL Server or SQL Server Express. Among the publishing options is SSL, which stands for secure sockets layer. (SSL is what you're using if you access a Web site using https:// instead of http://.) SSL encrypts the information going between the browser and server, and is a good idea for pages that involve private information like passwords and credit-card numbers. Setting up SSL requires extra steps like purchasing and configuring a certificate that's used for encryption. At HostASP, we offer Free SSL publishing URL when you do Web Deploy all your files are encrypted, safely and securely transferred to your HostASP Web hosting account. [b]Databases[/b] If you're using SQL Server Compact as your database, the data is stored in an .sdf file. When you publish the database, WebMatrix copies not only the .sdf file but also the database program itself to the web server. This ensures that the published site will work even if SQL Server Compact isn't already installed on the web server. If you're using a SQL Server or MySQL database, WebMatrix publishes the database by creating scripts that run in a database that has been created for you by your hosting provider. These scripts create database tables and insert data into them in order to replicate the structure and data that you have in the database on your computer. If you're using a SQL Server Compact database and want to publish to a SQL Server database, you must migrate the data to SQL Server before publishing. For instructions, see Migrate a database to SQL Server. You might want to do this to take advantage of SQL Server features such as stored procedures and its additional capabilities, such as handling more than 256 concurrent connections or creating databases larger than 4 gigabytes In this session we will see how to deploy our movies website, we earlier saw in other topic how to develop a simple movies website using MS SQL Compact DB. We will now deploy this website to our web hosting account on domain name http://www.yourwebhosting.in/ [b]Step 1: Preparing your Web Hosting Space[/b] Very first step that you would need to do is prepare your website for web publishing on our web hosting space. Login to your web hosting control panel, open website properties and setup a web deploy account ( this will create a windows NT account ). Use this account to configure the Publishing XML. This will enable your website for remote Website publishing. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-enabling-web-deployment_03.png[/img] To setup an web deploy account - Provide user name and password for your Web publishing and click on enable button. This will enable your web deployment account for web publishing. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-webdeploy-account_03.png[/img] You could see Web publishing is now enabled on your account. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-webpublishing-enabled_03.png[/img] You do have option to configure Web publishing XML - If you have multiple databases on your web hosting account and based on your application database type, you could choose a MS SQL database or My SQL database, The database user whom permission is granted and then the FTP account. Select your choice and rebuild the publishing XML. After rebuild is complete your publishing XML is saved and can be downloaded onto your local machine for import to WebMatrix. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-publishingsettings_03.png[/img] [b]Step 2: Configuring WebMatrix for Publishing[/b] Now that we configured our web hosting account for Web publishing, let us download the publishing XML file. The file that you download will have .publishsettings as extension , here in our case we will have yourwebhosting.in.publishsettings. Find below the structure of publishing XML file. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-publishingxml_02.png[/img] Now go to WebMatrix IDE on Top Menu -> Publish -> Settings and Import the file by clicking on "Import Publish Settings" this would default all the required fields with server information that you have on Publishing XML. Publishing XML supports both FTP method and Web deploy method. Let us see deployment using Web Deploy method. You would also notice that server name with https prefix, we have setup this URL with SSL certificate so that you can safely deploy your website over internet. One more thing you would notice is "Remote connection string not required" against this Movies DB it is because this MoviesDB application uses integrated SQL Compact Databases .SDF and so you would not require an explict or external MS SQL Server access on your hosting account, if your web application uses MSSQL or MySQL server then it would be filled in with information by default from Publishing XML. Ok, now that you have imported the settings lets Click on validate settings to connect to the server. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-import-publishingxml_03.png[/img] You have done your validation part and is successful, the information you have got on Publish setting is fine and able to connect to server. Click on save button to save this setting on your project. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-publishing-validatesettings_03.png[/img] [b]Step 3: Publishing[/b] You are done with the server validation part, let us now start publishing website. Click on Publish. This will perform compatibility check with the server to see you web application is compatible with the server / web hosting account. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-publish-compatibilitysettings_03.png[/img] Accept and proceed with compatibility check with the server. WebMatrix will upload few sample / test files to the server to check the server requirement for your website. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-compatibilitychecking-uploadingfiles_03.png[/img] You would then see WebMatrix validating the server requirement, for this MoviesDB website you would need ASP.NET setup and support for simple HTML on server. It is validated and WebMatrix found them available on our Web hosting account. Click on Continue to proceed with deployment. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-publish-compatibility-results_03.png[/img] The Publish Preview dialog box appears. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-publish-preview_03.png[/img] Review the list of files and databases and make changes if necessary. For example, you might want to clear check boxes under Changed Files to exclude some files. [quote]Important: If you're publishing a database and the database already exists in the hosting provider's site, whatever is in that database will be overwritten. [/quote] Click Continue. WebMatrix publishes the website, showing status messages in the navigation bar at the bottom of the screen. The publishing process is done in the background, which means you can continue to work in WebMatrix while it is publishing. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-publishing-yourwebhosting_02.png[/img] In the notification bar at the bottom of the screen, you can click Log to see a detailed log of the publishing activity. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-deployment-log_03.png[/img] If you see something in the log that catches your attention during the publishing process, you can click Pause Scroll to go back and examine what you saw more carefully. When the publishing process is complete, the notification bar lets you know: [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-publishing-complete_02.png[/img] [b]Step 4: Review Site[/b] To verify that publishing was successful, browse to the site. If you published a database, make sure you try any pages that display data from the database. [quote]Note: If your site has a Web.config file, the copy on your web hosting account on web server might look slightly different. For example, if you published a SQL Server database, it will have the our web hosting SQL connection string value so that the published site will use the database at the hosting provider.[/quote] [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-review-websites_03.png[/img] In the next Topic we will show how to download [b]DotNetNuke[/b] using WebMatrix Gallery, and set them up locally, test and then deploy remotely on a server. Getting Started with WebMatrix - Part-2 WebMatrix Create Website from Template 2011-09-22T11:34:46+00:00 2011-09-22T11:34:46+00:00 https://www.hostasp.net/forums/question/getting-started-with-webmatrix-part-2-webmatrix-create-website-from-template.html Jacob [b]This article will take a first look at using WebMatrix Application - Microsoft's WebMatrix IDE for developing Web Pages applications. I will walk you through number of the core features that will make WebMatrix an ideal starter's web development framework. [/b] [b]Creating your Website using WebMatrix[/b] [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-creating-site-from-template_03.png[/img] Choose the Site From Template option, and you’ll see the the dialog below. Note that you may see a number of different templates, as WebMatrix is growing all the time. The one we are interested in is the Empty Site template, we will start building website from here. Select this template and give it the name MoviesDB. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-site-from-template-is-created_02.png[/img] [b]Understanding WebMatrix IDE[/b] At the top, you see a Quick Access Toolbar and a Context menu / ribbon, as in Microsoft Office 2010. At the bottom left, you see the workspace selector, which contains buttons that determine what appears above them in the left pane. On the right is the content pane, which is where you view reports, edit files, and so on. Finally, across the bottom is the notification bar, which displays messages as needed. Coming back to our session, Website MoviesDB is now been created and is started by WebMatrix. From this screen above, you can manage files within the application, databases and perform site analysis on Reports Workspace. It is a database driven website that we are going to build now, so let us create a Database by clicking on Manage databases option. This will lead to screen below for database creation, [img]http://www.hostasp.net/articles/images/webmatrix/websitepanel-add-databases_03.png[/img] Click on 'Add a database to your site' will create a database and place DB file under APP_DATA folder. This folder is created by default at the time of Website creation. Name of database is your website name by default, this can be changed right clicking DB listed on left panel. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-add-table-definition_02.png[/img] Workspace above is for managing Database schemas. You can create Tables, and then define schemas – create columns, delete columns, create relationship between tables, add constraints, perform data operations, create indexes and more. - all these are just simply from your WebMatrix IDE working on SQL Server Compact. DDL or DML operations managed through selecting appropriate Table view - Definition / Data view. Now let us create all required columns for Table 'Movies'. To create new columns click on 'New column' link that is enabled on context menu. Create columns such as Title, Release date, Director and so on. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-tableschema-definition_02.png[/img] We just created a table called 'Movies' with all required columns for displaying data on our website. We will now proceed with data entry on this table, followed by retrieving this data and displaying the same on Web pages. If you would need to further normalize data then create few more tables split the data by normalizing them and then establish relationship between tables. You could see the context menu "Relationships" enabled on Workspace menu which will be used for relationship management. To enter data to the table click on 'Data' of Table views on context menu. This will open table that you had selected in data entry mode. Find list of movies information that i had entered on Movies table. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-table-dataentry_03.png[/img] We assume that you have created the default page if you have not then follow here [url=http://www.hostasp.net/forum/webmatrix-visual-studio-remote-deployment/123-creating-a-new-web-page-using-webmatrix-ide.html]Create a Web Page[/url] Let us now see how to use Razor Syntax to query the database and show the data on Web page. This is the new Razor syntax. The @ sign followed by a pair of braces denotes a multi-line code block, and could be thought of as equivalent to a non-code behind script runat="server" block. We are now going to test reading from the database, so let us add some code to do that: [code type="xml"] var db = Database.Open("MoviesDB"); var sql = "Select Title from Movies";[/code] WebMatrix.Data.Database is Database class libary which provides an easy set of methods for working with databases. One of the methods - "Open" sets up a connection and opens connection to the database name passed as parameter input to the method. Next line of code you will see simple SQL query. We will add some more code to the body of the page for simple display from Database MoviesDB: Movies Databases [code type="xml"] Movies Databases @foreach( var row in db.Query(sql)) { @row.Title } [/code] Database.Query() is a method that returns an IEnumerable. The SQL is executed against the database, and the rows of data returned are converted into a collection of objects, with the database field names exposed as properties of those objects. foreach is preceded with an @ sign, but no braces. This is because there is only a single line of code. The literal text and html markup in the second line is not considered part of the code block, but it is recognised by the Razor parser as belonging to the each iteration of the loop, and the closing brace confirms that. Inline expressions or variables are also preceded by the @ sign, as in @row.Title. The Razor parser will recognise these and replace them appropriately. We can see the result of this operation by clicking Launch in the menu, or simply hitting F12: Please find below the dynamic output of data from Database and how WebMatrix had made it so simple for Web application programming. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-moviesapp-browserexecution_03.png[/img] We will then discuss in detail about Web programming using Razor Syntax and about publishing websites to remote server - we will see how to use web deploy method to publish websites to HostASP Web hosting accounts from your development environment. Read more about - check related reference below [b]This article will take a first look at using WebMatrix Application - Microsoft's WebMatrix IDE for developing Web Pages applications. I will walk you through number of the core features that will make WebMatrix an ideal starter's web development framework. [/b] [b]Creating your Website using WebMatrix[/b] [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-creating-site-from-template_03.png[/img] Choose the Site From Template option, and you’ll see the the dialog below. Note that you may see a number of different templates, as WebMatrix is growing all the time. The one we are interested in is the Empty Site template, we will start building website from here. Select this template and give it the name MoviesDB. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-site-from-template-is-created_02.png[/img] [b]Understanding WebMatrix IDE[/b] At the top, you see a Quick Access Toolbar and a Context menu / ribbon, as in Microsoft Office 2010. At the bottom left, you see the workspace selector, which contains buttons that determine what appears above them in the left pane. On the right is the content pane, which is where you view reports, edit files, and so on. Finally, across the bottom is the notification bar, which displays messages as needed. Coming back to our session, Website MoviesDB is now been created and is started by WebMatrix. From this screen above, you can manage files within the application, databases and perform site analysis on Reports Workspace. It is a database driven website that we are going to build now, so let us create a Database by clicking on Manage databases option. This will lead to screen below for database creation, [img]http://www.hostasp.net/articles/images/webmatrix/websitepanel-add-databases_03.png[/img] Click on 'Add a database to your site' will create a database and place DB file under APP_DATA folder. This folder is created by default at the time of Website creation. Name of database is your website name by default, this can be changed right clicking DB listed on left panel. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-add-table-definition_02.png[/img] Workspace above is for managing Database schemas. You can create Tables, and then define schemas – create columns, delete columns, create relationship between tables, add constraints, perform data operations, create indexes and more. - all these are just simply from your WebMatrix IDE working on SQL Server Compact. DDL or DML operations managed through selecting appropriate Table view - Definition / Data view. Now let us create all required columns for Table 'Movies'. To create new columns click on 'New column' link that is enabled on context menu. Create columns such as Title, Release date, Director and so on. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-tableschema-definition_02.png[/img] We just created a table called 'Movies' with all required columns for displaying data on our website. We will now proceed with data entry on this table, followed by retrieving this data and displaying the same on Web pages. If you would need to further normalize data then create few more tables split the data by normalizing them and then establish relationship between tables. You could see the context menu "Relationships" enabled on Workspace menu which will be used for relationship management. To enter data to the table click on 'Data' of Table views on context menu. This will open table that you had selected in data entry mode. Find list of movies information that i had entered on Movies table. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-table-dataentry_03.png[/img] We assume that you have created the default page if you have not then follow here [url=http://www.hostasp.net/forum/webmatrix-visual-studio-remote-deployment/123-creating-a-new-web-page-using-webmatrix-ide.html]Create a Web Page[/url] Let us now see how to use Razor Syntax to query the database and show the data on Web page. This is the new Razor syntax. The @ sign followed by a pair of braces denotes a multi-line code block, and could be thought of as equivalent to a non-code behind script runat="server" block. We are now going to test reading from the database, so let us add some code to do that: [code type="xml"] var db = Database.Open("MoviesDB"); var sql = "Select Title from Movies";[/code] WebMatrix.Data.Database is Database class libary which provides an easy set of methods for working with databases. One of the methods - "Open" sets up a connection and opens connection to the database name passed as parameter input to the method. Next line of code you will see simple SQL query. We will add some more code to the body of the page for simple display from Database MoviesDB: Movies Databases [code type="xml"] Movies Databases @foreach( var row in db.Query(sql)) { @row.Title } [/code] Database.Query() is a method that returns an IEnumerable. The SQL is executed against the database, and the rows of data returned are converted into a collection of objects, with the database field names exposed as properties of those objects. foreach is preceded with an @ sign, but no braces. This is because there is only a single line of code. The literal text and html markup in the second line is not considered part of the code block, but it is recognised by the Razor parser as belonging to the each iteration of the loop, and the closing brace confirms that. Inline expressions or variables are also preceded by the @ sign, as in @row.Title. The Razor parser will recognise these and replace them appropriately. We can see the result of this operation by clicking Launch in the menu, or simply hitting F12: Please find below the dynamic output of data from Database and how WebMatrix had made it so simple for Web application programming. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-moviesapp-browserexecution_03.png[/img] We will then discuss in detail about Web programming using Razor Syntax and about publishing websites to remote server - we will see how to use web deploy method to publish websites to HostASP Web hosting accounts from your development environment. Read more about - check related reference below Getting Started with WebMatrix - Part-1 WebMatrix Installation 2011-09-22T03:23:35+00:00 2011-09-22T03:23:35+00:00 https://www.hostasp.net/forums/question/getting-started-with-webmatrix-part-1-webmatrix-installation.html Administrator [b]WebMatrix is a free, lightweight set of web development tools that provides the easiest way to build websites. It includes IIS Express (a development web server), ASP.NET (a web framework), and SQL Server Compact (an embedded database). It also includes a simple tool that streamlines website development and makes it easy to start websites from popular open source apps. The skills and code you develop with WebMatrix transition seamlessly to Visual Studio and SQL Server.[/b] The web pages that you create using WebMatrix can be dynamic—that is, they can alter their content or style based on user input or on other information, such as database information. To program dynamic Web pages, you use ASP.NET with the Razor syntax and with the C# or Visual Basic programming languages. If you already have programming tools that you like, you can try the WebMatrix tools or you can use your own tools to create websites that use ASP.NET. This topic shows you how WebMatrix makes it easy to get started creating websites and dynamic web pages. [b]Installing WebMatrix[/b] To install WebMatrix, you can use Microsoft’s Web Platform Installer (WPI), which is a free application that makes it easy to install and configure web-related technologies. If you don't already have the Web Platform Installer, download it from the following URL: http://go.microsoft.com/fwlink/?LinkID=205867 [img]http://www.hostasp.net/articles/images/webmatrix/installing-webmatrix_03.png[/img] Run the Web Platform Installer WPI, and then click install button to install WebMatrix. This would install WebMatrix and all its dependency components such as .NET Framework, IIS Express, SQL server Compact and Tools, ASP Web pages and language packs, and other required for setting up of WebMatrix development environment on Client machine. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-installation-complete_03.png[/img] After the installation is complete you would see the list of components that are installed on your machine along with WebMatrix for setting up development environment. [b]Running WebMatrix[/b] Direct access to WebMatrix is available as shortcut from Microsoft WebMatrix folder in your Start menu. Select the Microsoft WebMatrix icon and you'll launch WebMatrix. You'll see this Welcome screen: [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix_02.png[/img] The options on the Welcome screen support these ways of building a web site: [b]- Site From Web Gallery:[/b] The Web Application Gallery (WAG) is a collection of open source web applications written using a variety of technologies, including PHP and ASP.NET. Applications in the Web Application Gallery give you a great head start – where someone else has written a lot of the code for you and is allowing you to freely use it on your site. WebMatrix makes the process of downloading, installing and configuring this code easy. [b]- Site From Template:[/b] If you prefer to write your own code, instead of using the open source applications from the WAG, then this option gives you a great way to start with either an empty web site, or a number of simple template sites that you can customize and change. [b]- Site From Folder:[/b] If you have a collection of web files already and you want to edit and run them on a web server quickly, WebMatrix will allow you to do so, simply by pointing it at that folder. [b]Creating web sites with WebMatrix[/b] There are two main ways that developers would like to create web sites. The first is to use an Open Source web application (using the Site From Web Gallery option) where folks in the community have done a lot of the hard work for you. Perhaps you've heard of WordPress, Drupal, Joomla, Umbraco, DotNetNuke or Orchard? WebMatrix makes the process of downloading their code and configuring your server to run it on a simple and seamless process, regardless of the technology they're written in. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-quickstart-webgallery_03.png[/img] The other, is of course, to write everything yourself (using the Site from Template option). WebMatrix ships with the ASP.NET Web Pages framework which provides a very simple, yet very powerful way of creating dynamic web sites that use databases, and can integrate social frameworks, media and more. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-sitetemplates_03.png[/img] In next part you'll see how to use the ASP.NET Web Pages and integrated 'Razor' framework to see how easy it is to create a simple web site that provides a database of your favorite movies. You'll see how to get the site to work on all browsers, how to create web pages, how to make those pages dynamic by rendering data from a database, and lots more. [b]WebMatrix is a free, lightweight set of web development tools that provides the easiest way to build websites. It includes IIS Express (a development web server), ASP.NET (a web framework), and SQL Server Compact (an embedded database). It also includes a simple tool that streamlines website development and makes it easy to start websites from popular open source apps. The skills and code you develop with WebMatrix transition seamlessly to Visual Studio and SQL Server.[/b] The web pages that you create using WebMatrix can be dynamic—that is, they can alter their content or style based on user input or on other information, such as database information. To program dynamic Web pages, you use ASP.NET with the Razor syntax and with the C# or Visual Basic programming languages. If you already have programming tools that you like, you can try the WebMatrix tools or you can use your own tools to create websites that use ASP.NET. This topic shows you how WebMatrix makes it easy to get started creating websites and dynamic web pages. [b]Installing WebMatrix[/b] To install WebMatrix, you can use Microsoft’s Web Platform Installer (WPI), which is a free application that makes it easy to install and configure web-related technologies. If you don't already have the Web Platform Installer, download it from the following URL: http://go.microsoft.com/fwlink/?LinkID=205867 [img]http://www.hostasp.net/articles/images/webmatrix/installing-webmatrix_03.png[/img] Run the Web Platform Installer WPI, and then click install button to install WebMatrix. This would install WebMatrix and all its dependency components such as .NET Framework, IIS Express, SQL server Compact and Tools, ASP Web pages and language packs, and other required for setting up of WebMatrix development environment on Client machine. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-installation-complete_03.png[/img] After the installation is complete you would see the list of components that are installed on your machine along with WebMatrix for setting up development environment. [b]Running WebMatrix[/b] Direct access to WebMatrix is available as shortcut from Microsoft WebMatrix folder in your Start menu. Select the Microsoft WebMatrix icon and you'll launch WebMatrix. You'll see this Welcome screen: [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix_02.png[/img] The options on the Welcome screen support these ways of building a web site: [b]- Site From Web Gallery:[/b] The Web Application Gallery (WAG) is a collection of open source web applications written using a variety of technologies, including PHP and ASP.NET. Applications in the Web Application Gallery give you a great head start – where someone else has written a lot of the code for you and is allowing you to freely use it on your site. WebMatrix makes the process of downloading, installing and configuring this code easy. [b]- Site From Template:[/b] If you prefer to write your own code, instead of using the open source applications from the WAG, then this option gives you a great way to start with either an empty web site, or a number of simple template sites that you can customize and change. [b]- Site From Folder:[/b] If you have a collection of web files already and you want to edit and run them on a web server quickly, WebMatrix will allow you to do so, simply by pointing it at that folder. [b]Creating web sites with WebMatrix[/b] There are two main ways that developers would like to create web sites. The first is to use an Open Source web application (using the Site From Web Gallery option) where folks in the community have done a lot of the hard work for you. Perhaps you've heard of WordPress, Drupal, Joomla, Umbraco, DotNetNuke or Orchard? WebMatrix makes the process of downloading their code and configuring your server to run it on a simple and seamless process, regardless of the technology they're written in. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-quickstart-webgallery_03.png[/img] The other, is of course, to write everything yourself (using the Site from Template option). WebMatrix ships with the ASP.NET Web Pages framework which provides a very simple, yet very powerful way of creating dynamic web sites that use databases, and can integrate social frameworks, media and more. [img]http://www.hostasp.net/articles/images/webmatrix/webmatrix-sitetemplates_03.png[/img] In next part you'll see how to use the ASP.NET Web Pages and integrated 'Razor' framework to see how easy it is to create a simple web site that provides a database of your favorite movies. You'll see how to get the site to work on all browsers, how to create web pages, how to make those pages dynamic by rendering data from a database, and lots more.