这个页面无法在IIS中显示。

5
我是一个有用的助手,可以翻译文本。
所以我在Web开发方面还比较新。我正在尝试为我的老板构建一个小型演示项目,作为概念证明。我已经在VS2015中构建了该站点,并在VS Webhost中进行调试运行/工作。现在我正在尝试将其转移到为此设置的服务器上。
这里是我采取的步骤: 1.) IIS已安装,我可以看到默认页面。 2.)我已验证iis用户可以访问物理路径。 3.)我已设置匿名身份验证。 4.)我已启用目录浏览
这就是我开始遇到问题的地方。当我打开浏览器并导航到地址或从iis管理器右键单击浏览网站选项时,我会看到“无法显示此页”错误。我查找了一些解决方案,但没有一个有效。我最希望有任何进展的主要解决方案是进入:
Internet选项菜单->高级选项卡->“设置”框中的“浏览”->取消选中“显示友好的HTTP错误消息”
即使取消了此选项,仍然会看到“无法显示此页”的错误。如果页面继续显示错误,也没有其他反馈或解决方案。我已尝试重新启动iis浏览器和物理服务器,但没有任何更改。我希望有人之前遇到过这个问题,解决方案很简单,我错过了它,只是因为我还是新手。
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs"    Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>CommonUse Web Demo</title>
<link href="App_Code/PageStyle.css" rel="stylesheet" type="text/css" />
</head>
<style>
.VerticalLine 
{
border-left: thick solid #000000;
}    
th, td
{
padding: 5px;
text-align: left;
}
.TableLayoutSideBar
{
width: 200px;
}
.TableLayoutMainBar
{
width: 1000px;
}
.TBL_VerticalHeader {
    width: 75px;
}
</style>
<body>
<form id="form1" runat="server">
    <div>
        <table cellpadding="0" cellspacing="0">
            <tr>
              <th class="TableLayoutSideBar">                     
              </th>
                <th class="TableLayoutMainBar">
                 <h1 style="text-align:center;">Common Use Web Demo</h1>
              </th>
                <th class="TableLayoutSideBar">                     
              </th>
           </tr>  
           <tr>
              <td class="TableLayoutSideBar">
              </td>
                <td class="TableLayoutMainBar">
                    <table cellpadding="0" cellspacing="0">
                    <tr>
                      <th class="TBL_VerticalHeader">   
                          <asp:Label runat="server" Text="Input"/>                 
                      </th>
                        <td class="TableLayoutSideBar">          
                            <asp:Label runat="server" Text="Input Range: 0-9"/>                       
                            <asp:TextBox ID="Tbx_Input" runat="server" Width="100px"/>                             
                      </td>
                        <td class="TableLayoutSideBar">                                
                             <asp:Button ID="Btn_Submit" runat="server" Text="Submit" OnClick="Btn_Submit_Click" />                              
                      </td>
                   </tr>  
                   <tr>
                      <th class="TBL_VerticalHeader">
                          <asp:Label runat="server" Text="Output:"/> 
                      </th>
                        <td class="TableLayoutSideBar" colspan="2">
                            <asp:Label ID="Lbl_Output" runat="server" Text="Please Input a Number"/>
                      </td>
                   </tr>                
                </table>
              </td>
                <td class="TableLayoutSideBar">
              </td>
           </tr>                
        </table>
    </div>
</form>
</body>
</html>

第一步是尝试获取HTTP错误代码。请查看以下内容,并尝试找到正在生成的HTTP错误代码:http://blogs.iis.net/ma_khan/troubleshooting-iis-6-status-and-substatus-codes。有时打开F12控制台,转到网络选项卡也可以提供更多有用的信息。 - Nick.McDermaid
地址栏中的URL是什么?与IIS端的站点绑定进行比较。 - Lex Li
@LexLi,我不确定你要什么,当我在VS2015之外运行它时,地址只是“localhost:xxxx”,我正在尝试将iis设置为“demo.commonuse.com”,并且应默认为页面“\deafult.aspx”。 - mmp786
所以我想我刚刚解决了自己的问题...我正在尝试设置一个地址,但是现在我已经从绑定中删除了“demo.commonuse.com”,现在它可以正常显示了。谢谢大家的帮助。这个问题是由于我的愚蠢/新手引起的。 - mmp786
1
@mmp786 发布并接受它作为答案。 - Lex Li
显示剩余5条评论
1个回答

5

我已经解决了自己的问题... 我正在尝试设置一个地址。我从绑定中删除了“demo.commonuse.com”,现在一切正常。因为我还没有为它设置域,所以它需要使用机器的IP地址作为地址。谢谢大家的帮助。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接