.Net开发MVC网站经验记录

项目组成说明

1.launchSettings.json

在这里插入图片描述
launchSettings.json里面记录了网站运行时的配置。

{
   
   
  "iisSettings": {
   
   
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
   
   
      "applicationUrl": "http://localhost:45224",
      "sslPort": 0
    }
  },
  "profiles": {
   
   
    "PersonalSoftwareDevelopmentRecordWebsite": {
   
   
      "commandName": "Project",
      "dotnetRunMessages": true,
      "launchBrowser": true,
      "applicationUrl": "http://localhost:5009",
      "environmentVariables": {
   
   
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "IIS Express": {
   
   
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
   
   
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}

最常用的applicationUrl地址,一个是IIS运行的地址,一个是项目运行的地址。

2.wwwroot

在这里插入图片描述
在wwwroot里面可以存放我们的css,js,image等一些资源,以及.net框架给我们封装好了一些可直接调用的资源在lib文件夹下的bootstrap,jQuery可以说非常方便,里面有bootstrap的官网案例。

注意:在wwwroot下的资源路径调用
"~/xxx"代表在wwwroot文件夹下的资源,例如调用wwwroot文件夹下的图片路径:

<img src="~/images/ghs.png" />

还有利用bootstrap框架搭建的轮播图代码:

<div id="carouselExampleCaptions" class="carousel slide" data-bs-ride="carousel" data-bs-touch="false">
        <div class="carousel-indicators">
            <button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
            <button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="1" aria-label="Slide 2"></button>
            <button type
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值