Use Win10 to publish asp.net Web sites from IIS

Source: Internet
Author: User
IIS publishes asp.net web site

When learning Android, because you did not learn to use JSP to build the site backstage, you need to use ASP.net to write a Web site background program to respond to the app's network request. Because ASP.net and Android localhost are not the same, can not access each other, local debugging is very inconvenient, Bo main intelligence through the mobile phone to connect Wi-Fi way to share the local area network.
Here's a simple example of how to use IIS to publish a Web site. (VS2015)

1. Write a simple ASPX daemon with the following code:

public partial class _default:system.web.ui.page
{
    protected void Page_Load (object sender, EventArgs e)
    { C4/>if (request.params["username"] = = "Hugh" && request.params["age"] = = "a")
        {
            Response.Write ("Ture ");
        }
        else
        {
            Response.Write ("false");
        }
    }

2. After the successful commissioning, right key project name, select "Publish Web Application", directly on the map, the final direct release can be.


3. Search IIS directly with Natalie and open, above.


4. Add "Default document", preferably enable "directory browsing." If you open the default document error, be aware that the Default.aspx is set as the default page in the Web.config file, and if it is already set, annotate it, as shown in the following code example

<?xml version= "1.0"?>
<!--
  For more information about how to configure the ASP.net application, visit
  http://go.microsoft.com/fwlink/? linkid=169433
  -->
<configuration>
  <system.web>
    <compilation targetframework= " 4.5.2 "debug=" true "/>
    


5. online Basic To this step is no one to teach, but most people still can not normally visit their website, error 400,500, and so on. Please focus on whether the following configurations are complete:
1 Open "programs and features" To see if the IIS configuration is complete and find the following:

2 subsequently check the published Web site folder permissions, as follows:
Right-click the site folder-> Properties-> Security, add iis_iusrs,iusr, click Edit-> Add-> Advanced-> Find Now, find iis_iusrs,iusr, confirm Add, check "Full Control" respectively.




The above can basically solve most problems, if there is a better way, welcome correction.

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.