2010-08-18 68 views
1

當內容放置在contentplaceholder內時,鏈接的行爲發生變化,我必須刷新頁面才能使下載鏈接正常工作。放置contentplaceholder時,我還必須刪除表單標記。如何修改鏈接的行爲,同時讓contentplaceholder引用我的母版頁? (刪除了一些代碼以縮短隱私)ASP.net視圖狀態鏈接錯誤

<asp:Content runat="server" ContentPlaceHolderID="PlaceHolderMain"> 

<!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 > 
    <title></title> 
<style type="text/css"> 
</style> 
</head> 
<body> 
    <%--<form id="ThisForm" runat="server">--%> 
    <div> 

     <table style="width:100%;"> 
</table> 
</div> 
</body> 
</html> 
</asp:Content> 

回答

0

ContentPlaceHolders替換頁面中的內容。一個MasterPage就像一個你應用於頁面的模板。它擁有你想要的所有基本功能和佈局。

因此,當您基於MasterPage創建頁面時,頁面將使用來自MasterPage的Form和標記作爲基礎。你只需填補空白(你的ContentPlaceHolders)。

你想刪除所有的標記,只把你需要的ContentPlaceHolder。