2017-02-28 40 views
0

我想創建一個網站使用Visual Studio 2015 Bootstrap和HTML,但到目前爲止,我有代碼不運行,我收到一條錯誤消息。基本網站得到錯誤CS1002:;預計

enter image description here]

Iv'e也跟隨在本網站的說明:HTMLGoodies.com

這裏是我的代碼至今:

<html xmlns="http://www.w3.org/1999/xhtml"> 

    <head runat="server"> 
    <title>Time Entry</title> 
    <meta charset="utf-8" /> 
    <meta name="viewport" content="width=device-width, initial-scale=1" /> 
    <link rel="stylesheet" href="bootstrap.min.css" /> 
    <script src="bootstrap.min.js"></script> 
    <link rel="stylesheet" href="bootstrap-theme.min.css" /> 
    </head> 

    <body> 
    <form id="form1" runat="server"> 
     <div class="container-fluid"> 
     <h1>Logo Book</h1> 
     <p>Discover Artists and Shape Your Perfect Logo</p> 
     </div> 
     <div class="row"> 
     <div class="col-md-4" style="background-color:blue;"> 
      Welcome to Logo Book where you can browse through potyfolios of your prefered artist and see what they have to offer. 
     </div> 
     <div class="col-md-4" style="background-color:palegoldenrod;"> 
      Looking for an easier way to get in touch with these artists and give specific details needed for your project? 
     </div> 
     <div class="col-md-4" style="background-color:coral;"> 
      Feel free to use our Q&A section to voice and submit your needs such as fonts and images! 
     </div> 

     </div> 
    </form> 
    </body> 

</html> 
+0

這可能是因爲你不能從數字(WebSite1.2中的2)開始使用標識符,尤其是名稱空間,請參見[this question](http://stackoverflow.com/questions/4949731/numbers-in-命名空間)另一個誤導性編譯器錯誤的案例。 – Zong

+0

你是對的宗,我用一個簡單的名字,網站1開始了一個新的網站項目,現在它運行正常。感謝您的見解! –

回答

0

我跑這個確切的代碼我電腦,它運行得很好。你如何試圖運行這段代碼?測試代碼是否工作的最簡單方法是將其輸入.html文件,然後使用瀏覽器打開它。

0

該代碼也可以在.aspx頁面中正常工作。在創建新的Web應用程序時,Global.asax頁面不包含行號2,3和4.要運行該頁面,只需刪除它們並運行即可。它一定會運行。如果您想使用第2行,請詳細描述您寫這一行的目的。所以我們可以根據它找到解決方案。