2013-01-22 45 views
3

你好,我是爲ASP.NET如何將HTML頁面轉換爲.aspx頁面,添加/不改變頁面佈局中刪除控制它

一個新手我有一個設計的HTML頁面從另一個程序,我想使用visual web developer將html轉換成一個asp.net aspx web窗體。

我已經正常打開頁面,但是很難在佈局頁面中移動或替換控件,例如當我移動按鈕時,頁面設計崩潰。 如何在不改變頁面佈局的情況下將按鈕或文本框插入Visual Web Developer 2010上的aspx/html?

+0

您是否有任何HTML知識?這聽起來很奇怪,但Visual Studio並不打算用於所見即所得開發的舊版FrontPage。 – Androiderson

+0

是的,我知道HTML 基地所以有這樣的解決方案? – MFBCTRC

+0

是否要將html頁面轉換爲.aspx頁面?或者你想插入文本框/按鈕到已經設計好的頁面中? - 您的第二個問題難以理解。 – Sakthivel

回答

4

到HTML頁面轉換成aspx頁面,

1. Create a new web form in visual web developer. 
2. Copy the content from body of the html file , paste it in body of the aspx page. 
3. Similarly copy the script, meta tags from head section of html , paste it in head section of aspx page. 
4.if any external style sheet,Images included with html file, add them appropriately in a folder of your asp.net application. 
5.Now try to run the page and check if everything appears well, if not appearing well check the stylesheet and make some small changes. 
6.Check at the top of the page asp.net , <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> it is necessary. 

實踐會給你的CSS,造型和HTML完美。

-------------------所有應該很好--------------

如果你不這樣做在代碼後面找到任何控件,在標記中添加[runat =「server」]屬性。 並且是一個html控件,並且是服務器控件。


+0

OK Codebrain,非常感謝您的解決方案,我已經嘗試了所有的提示,並且幾乎成功了。在可視化網頁開發者頭部佈局菜單設計的頁面被改變,但在瀏覽器上,通常沒有佈局改變位置。 我的問題爲什麼會發生?好吧,它並不重要。最重要的問題是,我可以在Visual Web Developer上鎖定標題菜單或組件,以便我可以編輯正文部分? – MFBCTRC

+0

如果您下載了一些靜態html模板,您需要檢查設計並根據您的要求進行修改。嘗試處理HTML表格和div標籤。它會給你很好的設計經驗。使用CSS樣式表。您可能會在div或table標籤中發生錯誤並指定高度和寬度。[如果您回答有幫助,請將其標爲答案]。謝謝 – Sakthivel