2017-09-26 44 views
0

我已經上傳Default.aspx,PrecompiledApp.configweb.config我的文件管理器在服務器,但當我打電話Default.aspx它顯示瀏覽器中的文件代碼。.net文件上傳到在線服務器,但只顯示代碼,而運行

<%@ page language="C#" autoeventwireup="true" inherits="_Default, App_Web_jpizvube" %> 

<!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></title> 
    <script language="javascript" type="text/javascript"> 
// <![CDATA[ 

     function category_onclick() { 

     } 

     function fromM_onclick() { 

     } 

// ]]> 
    </script> 
</head> 
<body> 
<form runat=server> 
    <table border="2" cellpadding="10px" cellspacing="10px"> 
    <tr> 

    <td colspan="2" align="center"><h3>Register New Customer</h3> 
    </td> 
    </tr> 

<tr> 
<td>Choose Category 
</td> 
<td> 



    <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
     onselectedindexchanged="DropDownList1_SelectedIndexChanged"> 
    </asp:DropDownList> 

    </td> 
    </tr> 


    <tr> 
    <td>Choose Subcategory 
    </td> 
    <td> 
     <asp:DropDownList ID="DropDownList4" runat="server" AutoPostBack="True" 
      onselectedindexchanged="DropDownList4_SelectedIndexChanged"> 
     </asp:DropDownList> 




    </td> 

    </tr> 

    <tr> 
    <td>Choose lowersubcategory 
    </td> 
    <td> 

     <asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="True"> 
     </asp:DropDownList> 

    </td> 
    </tr> 



    <tr> 
    <td> Choose Location 
    </td> 
    <td> 


     <asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True" 
      onselectedindexchanged="DropDownList2_SelectedIndexChanged"> 
     </asp:DropDownList> 
</td> 
    </tr> 

    <tr> 
    <td>Longitude<br/><br/> 
    Latitude 
    </td> 
    <td> 
     <asp:TextBox ID="TextBox1" runat="server" AutoPostBack="True" ></asp:TextBox> 
     <br /> 
     <br /> 
     <asp:TextBox ID="TextBox2" runat="server" AutoPostBack="True" ></asp:TextBox> 
    </td> 
    </tr> 

    <tr> 
    <td>Name 
    </td> 
    <td> 

     <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox> 
    </td> 
    </tr> 

    <tr> 
    <td>Address 
    </td> 
    <td> 
     <asp:TextBox ID="TextBox4" runat="server" TextMode="MultiLine"></asp:TextBox> 

    </td> 
    </tr> 


    <tr> 
    <td>Image 
    </td> 
    <td> 
     <asp:FileUpload ID="FileUpload1" runat="server" /> 

    </td> 
    </tr> 


    <tr> 
    <td>Contact Number 
    </td> 
    <td> 
     <asp:TextBox ID="TextBox5" runat="server" ></asp:TextBox> 

    </td> 
    </tr> 

    <tr> 
    <td>Website 
    </td> 
    <td> 
     <asp:TextBox ID="TextBox6" runat="server"></asp:TextBox> 

    </td> 
    </tr> 

<!--<tr> 
    <td> 
    </td> 
    <td> 
    </td> 
    </tr>--> 
    <tr> 

    <td>Working Hours</td> 
    <td> 
    <label>Monday to Friday</label> 
     <asp:CheckBox ID="CheckBox1" runat="server" /> 
     <asp:DropDownList ID="DropDownList9" runat="server"> 
      <asp:ListItem Value="6:00AM"></asp:ListItem> 
      <asp:ListItem Value="6:30AM"></asp:ListItem> 
      <asp:ListItem Value="7:00AM"></asp:ListItem> 
      <asp:ListItem></asp:ListItem> 
     </asp:DropDownList> 



<label>to</label> 

<asp:DropDownList ID="DropDownList10" runat="server"> 
    <asp:ListItem>6:00AM</asp:ListItem> 
     </asp:DropDownList> 


    <br /> 
    <br /> 
    <label>Saturday</label> 
     <asp:CheckBox ID="CheckBox2" runat="server" /> 

     <asp:DropDownList ID="DropDownList5" runat="server"> 
     </asp:DropDownList> 


<label>to</label> 

     <asp:DropDownList ID="DropDownList8" runat="server"> 
     </asp:DropDownList> 
<br /> 
<br /> 
<label>Sunday</label> 
     <asp:CheckBox ID="CheckBox3" runat="server" /> 

     <asp:DropDownList ID="DropDownList6" runat="server"> 
     </asp:DropDownList> 
<label>to</label> 

     <asp:DropDownList ID="DropDownList7" runat="server"> 
     </asp:DropDownList> 

    </td> 
    </tr> 


    <tr> 
    <td colspan="2" align="center"> 
     <asp:Button ID="btn_Submit" runat="server" Text="Register" 
      onclick="btn_Submit_Click" /> 
    &nbsp;&nbsp;&nbsp; 
    <input type="reset" value="Cancel"/> 
    </td> 

    </tr> 

</table> 
</form> 
</body> 
</html> 

請幫我正確部署,運行此代碼在Visual Studio很好,當我試圖上傳到服務器後,相同的文件它顯示在瀏覽器這個源代碼。

+0

它是一個新的服務器?你運行「ASP.NET IIS註冊工具」嗎? FYI - https://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx – Dinny

+0

其舊服務器,但直到現在我還沒有使用任何.net項目在服務器 –

+0

因爲這是你第一次運行.Net項目在服務器,請嘗試立即運行ASP.NET IIS註冊並再次檢查。 – Dinny

回答

-1

您需要向IIS註冊ASP.NET處理程序,並且爲此需要運行aspnet_Regiis.exe,請嘗試以管理員權限運行該命令。 exe文件的位置是c內:\ WINDOWS \ Microsoft.NEt \框架\ v4.0.30319

aspnet_regiis -i 

你可以閱讀更多關於它從這裏https://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx

相關問題