ASPX文件仅显示代码

时间:2016-09-22 12:39:51

标签: c# asp.net

我一直试图将我的网站上传到我的Hostinger域几天,但是出于某种原因,.aspx文件显示原始代码,并且在浏览器中运行时不显示任何GUI。 你会怎么建议?

<%@ Page Title="" Language="C#" MasterPageFile="~/Mater Pages/Primary.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
 .auto-style1 {
  width: 873px;
  height: 455px;
  }
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent"   Runat="Server">
<h2 style="text-align: center">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hello and   welcome to my personal website. I hope that you enjoy your visit.</h2>
<h3 style="text-align: center">
    If for any reason you can&#39;t find exactly what you are looking for then please use the contact form <a href="Main%20Pages/Contact%20Me.aspx">here</a> and you&#39;ll get a response within 2-3 working days</h3>
<h3 style="text-align: center">
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <img alt="" class="auto-style1" src="Images/Default/image%20for%20hompage.png" /></h3>
<p style="text-align: center">
    &nbsp;
    <script async  src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Website Ad Test -->
<ins class="adsbygoogle"
 style="display:inline-block;width:728px;height:90px"
 data-ad-client="ca-pub-8284273019831171"
 data-ad-slot="7241345648"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</p>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1"   Runat="Server">
</asp:Content>

2 个答案:

答案 0 :(得分:1)

看看Hostinger的网站,我认为他们不支持.net框架。

答案 1 :(得分:0)

您的服务器似乎没有执行.aspx网页中的代码,它只返回它的内容(源代码)。

与您的Web服务器提供商联系,确保他们正在为.NET页面提供服务。