2017-09-05 58 views
0

我有一個頁面,其中包含一個顯示查詢結果並具有分頁和搜索欄的網格視圖。它可以正常工作,但當我將主頁添加到它時,所有控件都消失了。下面是與母版頁和不主頁阻止搜索欄

<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" 
CodeFile="Default3.aspx.cs" Inherits="_Default" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" 
Runat="Server"> 
<%@ Import Namespace="GridView" %> 


<div> 
    <div align="center" class="padded" > 
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
Font-Size="Large" OnSelectedIndexChanged="Refresh_Click"> 
</asp:DropDownList> 
<asp:Button ID="Refresh" runat="server" OnClick="Refresh_Click" 
Text="Search" Visible="False" /> 
</div> 
<div> 
    <cc1:HTMLGridView ID="HTMLGridView1" runat="server" 
OnRowDataBound="OnRowDataBound2"/> 
    </div> 

下面的代碼是沒有母版頁作品

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" 
Inherits="_Default" %> 
<%@ Register assembly="GridView" namespace="GridView" tagprefix="cc1" %> 
<!DOCTYPE html> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
<title></title> 
</head> 
<body> 
<form id="form1" runat="server"> 
<div> 
    <div align="center" class="padded" > 
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
Font-Size="Large" OnSelectedIndexChanged="Refresh_Click"> 
</asp:DropDownList> 
<asp:Button ID="Refresh" runat="server" OnClick="Refresh_Click" 
Text="Search" Visible="False" /> 
</div> 

    <cc1:HTMLGridView ID="HTMLGridView1" runat="server" 
OnRowDataBound="OnRowDataBound2" allowDeleting="False" allowEditing="False" 
allowView="False"/> 

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

我還添加了參考web.config文件中的代碼,但我有沒有運氣

<add tagPrefix="cc1" namespace="GridView" assembly="GridView" /> 

我在哪裏出錯了?

+0

加入

<%@ Import Namespace="GridView" %> 

顯示您的主阿Page',如何使代碼在它 – Webruster

回答

0

嘗試之前

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" 
Runat="Server"> 
+0

仍然沒有運氣。它沒有顯示搜索欄或分頁。 – Marcus