asp.net - 在 Microsoft Windows Azure 上设置网站的默认网页

标签 asp.net vb.net azure hosting

我最近在 azurewebsites.net 上建立了一个网站。

但是当我访问 URL http://website.azurewebsites.net/时 它无法加载。

但是当我访问 http://website.azurewebsites.net/home.aspx 时,它会加载。

我想要的是 如果用户访问 http:/website.azurewebsites.net/,它会加载 home.aspx 内容或重定向到 http:/website.azurewebsites.net/home.aspx

这不起作用

 <system.webServer>
   <defaultDocument>
     <files>
       <clear />
       <add value="Default.aspx" />
     </files>
   </defaultDocument>
  </system.webServer>

抱歉,这是实际链接 http://rathgarfantasyhockey.azurewebsites.net/default.aspx效果很好,但是当您转到 http://rathgarfantasyhockey.azurewebsites.net 时HTTP 错误 404,显示找不到资源

谁能帮忙吗?

最佳答案

根据这篇博文:http://blogs.msdn.com/b/cesardelatorre/archive/2010/07/22/how-to-set-a-default-page-to-a-windows-azure-web-role-app-silverlight-asp-net-etc.aspx

<defaultDocument> 
          <files>                           
             <clear/>                           
             <add value="Default.aspx"/>                      
          </files>
</defaultDocument>

应该可以工作。或者您可以将“类型”映射到“URL”。为此,请查看 http://msdn.microsoft.com/en-us/library/cc668201.aspx

关于asp.net - 在 Microsoft Windows Azure 上设置网站的默认网页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12126518/

相关文章:

asp.net - 如果 (fileUpload.HasFile)=false

vb.net - 如果我在 vb.net 中输入数字,Visual Studio 2012 会将数字添加到我的 double 值中

asp.net - 是否可以让 asp.net 转发器的数据源是作为类属性的 list<string> ?

c# - 遍历记录并根据条件更新数据库

.net - 如何在设置为只读的 .NET TextBox 中选择(突出显示)文本?

C# DefaultAzureCredentials + Visual Studio

web-applications - Azure 网站发布使用中的文件失败

azure - azure资源管理(管理器)和控制平面之间有什么关系?

asp.net - 从 aspnet_Profile 检索数据

javascript - 使用 ASP :DropDownList is proving difficult 中的值填充弹出窗口