【问题标题】:Masterpage blocking search bar母版页阻止搜索栏
【发布时间】:2017-09-05 00:55:53
【问题描述】:

我有一个带有网格视图的页面,它显示查询结果,并具有分页和搜索栏。当我在没有母版页的情况下自行加载它时它工作正常,但是当我将母版页添加到它时,所有控件都会消失。下面是有母版页的代码,没有

<%@ 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" />

我哪里错了?

【问题讨论】:

  • 显示您的 Master Page ,代码在其中的样子

标签: asp.net winforms master-pages


【解决方案1】:

尝试添加

<%@ Import Namespace="GridView" %>

之前

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

【讨论】:

  • 还是没有运气。它没有显示搜索栏或分页。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-01-27
相关资源
最近更新 更多