I'm running a localhost server for my web application in C# ASP.NET, and i'm having some troubles with the file paths, whenever i sue the title ~ to go into the root file path, the IIS concatenate it into the path. So instead of "~/images/logo.png/" it goes "folderAtTheMoment/~/images/logo.png
I don't know if it is because i'm using Site.Master.
Here's the code:
<%@ Master Language="C#" AutoEventWireup="true"
CodeBehind="UnloggedSite.Master.cs" Inherits="SiteMaster.SiteMaster" %>
<!DOCTYPE html>
<html lang="en">
<head runat="server">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Este site tem como finalidade servir para um projeto de finalização de curso no ensino superio, PIM Exchange" />
<title>PIM Exchange - <%: Page.Title %></title>
<link href="~/Content/UnloggedSite.css" rel="stylesheet" />
<link href="~/LogoPIMExchange.ico" rel="shortcut icon" type="image/x-icon" />
</head>
<body runat="server">
<div class="TopBar" style="display:inline">
<a href="UnloggedHome.aspx">
<img src="~/images/LogoPIMExchange.png" alt="Logo" class="imgLogo" style="display:inline"/>
<p style="display: inline">PIM Exchange</p>
</a>
<div class="TopBarOptions" style="display:inline">
<a href="~/Account/Login.aspx" id="Login" style="display: inline">Log in</a>
<a href="~/Account/Register.aspx">Register</a>
</div>
</div>
<div class="SideNav">
<br /><br />
<div class="SideNavBottom">
<a href="~\SobreNós.aspx">Sobre nós</a><br /><br />
<a href="~\Contato.aspx">Contato</a><br /><br />
</div>
</div>
<div class="body-content">
<asp:ContentPlaceHolder ID="MainContent" runat="server">
</asp:ContentPlaceHolder>
<hr />
<footer>
<p class="footerCss">© <%: DateTime.Now.Year %> - PIM Exchange. All rights reserved.</p>
</footer>
</div>
</body>
</html>
And here's the Error:
Server Error in '/' Application. The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /~/Account/Login.aspx
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4210.0
Aucun commentaire:
Enregistrer un commentaire