ASP. MVC5 QuickStart--myfirstweb and publishing to Windows Azure

Source: Internet
Author: User

Bo master just learn ASP. NET MVC5, look at Microsoft's documentation a little bit of learning, the establishment of Firstweb to show the next, this time to establish an example with personal authentication (that is, a dynamic Web page with registration login mechanism), start, Cheer ~ ~

Create a new project, select Web->asp.net,

When you are sure, make sure that the information is selected

OK, you will see the following page, the resource group can not be new, I understand that the resource group is analogous to our Computer folder, I use my original set up a resource group, the database server does not have to create a new, after the completion, enter their own database password, to remember this database password AH ~ ~

The solution file that you got after you identified is similar to Jiangzi ~

Here is an extremely useful tool, Entity Framework (EF) Code first. We open the Package Manager console, Input: enable-migrations, enter, just like Jiangzi ~

We are here on the basis of the template, add a number of attributes, so enter Models\identitymodels.cs, add public class Applicationuser:identityuser {public string studentid{get; set;}}

Just like this.

OK, use string to indicate StudentID bad, I am wrong, I will change.

When we add a property, we should update the database to reflect the change. This will tell you why EF works ... In the Package Manager console, enter: Add-migration "StudentID", this action will add a migration folder to your project. Enter: Update-database to update the database.

Add the StudentID property in Models\accountviewmodels.cs. Just like this.

Add StudentID to Views\account, just like this

    <class= "Form-group">        @Html. Labelfor (M=>m.studentid, New {@class = "col-md-2 Control-label"})        <class= "col-md-10" >             @Html. textboxfor (M = M.studentid, new {@class = "Form-control"})        </div< /c18>>    </div>

Update the register Action in AccountController, just like this

Then debug to see the effect

Publish: Right-click on project and you will see this

After the configuration in the inside (in fact there is nothing to configure, Microsoft to help you fix it, you really can not verify the connection, preview what), publish, wait a moment, your site has been published to Azure above.

ASP. MVC5 QuickStart--myfirstweb and publishing to Windows Azure

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.