我剛剛開始使用asp.net,並創建了一個Web應用程序,我想上傳到我的網站,這樣我就可以在localhost以外的地方測試它。上傳一個asp.net到主機(GoDaddy)
我上傳了當我通過Web服務器上的FTP將應用程序構建到文件夾時輸出的所有文件,但是當我嘗試導航到我製作的aspx頁面時,出現錯誤'無法加載鍵入'MyWebsite.MainMaster'。'我認爲這與內容頁面鏈接到的母版頁有關。
我已閱讀有關可能需要IIS的某些內容,但似乎找不到解釋它是什麼以及它具體做什麼的任何內容。無論如何,我使用GoDaddy作爲主機。
如何真正讓網站運行的任何幫助將是偉大的!如果我忘記了任何信息,我將很樂意分享。 謝謝!
這是主頁面的HTML,這是錯誤彈出的地方。具體行首是<%@ Master Language =「C#」...>。 我還沒有編輯任何C#文件。
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MainMaster.master.cs" Inherits="MyWebsite.MainMaster" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Master Page Test</title>
<link href="main.css" rel="stylesheet" type="text/css"/>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div id="headerContainer">
<div id="headerContent">
<h1>ASP.NET Test/h1>
</div>
</div>
<div id="buttonContainer">
<div id="buttonBar">
<ul>
<li class="buttons activeButton">
<a href="../">Home</a>
</li>
<li class="buttons">
<a href="../about">About</a>
</li>
<li class="buttons">
<a href="../placeholder">Placeholder</a>
</li>
<li class="buttons">
<a href="../contact">Contact</a>
</li>
</ul>
</div>
</div>
<div id="bodyContainer">
<asp:ContentPlaceHolder ID="bodyContent" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
而且MainMaster.Master.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MyWebsite
{
public partial class MainMaster : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
IIS是Internet Information Services,微軟的網絡服務器軟件。這就是Go Daddy在他們的服務器上運行的東西。去谷歌上查詢。 嘗試在上傳到服務器之前在本地運行網站(您是否使用Visual Studio?)。 – mason
@ msm8bball我正在使用Visual Studio 2013,並嘗試併成功地通過調試在本地運行站點。我在搜索IIS時發現的大部分內容都沒有提及如何使用它或者我是否明確需要它。 – Maccyjam
Go Daddy正在其服務器上運行IIS(只要您有Windows主機)。儘管可以進行配置更改,但您不必設置它。當你在VS 2013中進行調試時,你實際上正在運行一個迷你版本的IIS。不過,不要爲此煩惱。只要確保您的文件正確上傳到服務器。查看您的網站失敗的行號,然後在此發佈相關代碼(編輯您的帖子)。 – mason