在母版页中无法使面板可见 [英] In Master Page unable to make a panel to visible

查看:56
本文介绍了在母版页中无法使面板可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在以下母版页代码中,我无法在运行时显示Panel1。没有错误,但屏幕是空白的。

In the following 'master page' code I am unable to show the Panel1 while running. No error comes but the screen is blank.

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!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 runat="server">
    <title>Untitled Page</title>
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <div>
         <asp:Panel ID="Panel1" runat="server" BackColor="Red" Width="1000" Height="300">
         </asp:Panel>
    <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>

推荐答案

我已经尝试过你的html代码,它的工作没有问题。



看看你是否在代码behid或某处提到了什么。
I have tried your html code it's working there is no problem.

See if you have mentioned anything in code behid or somewhere.


我已经测试了你的代码它正常工作......很好,这段代码没有问题
I have tested your code it working...fine there is no problem in this code


你必须在contentplaceholder中保持面板:)
You have to keep panel with in contentplaceholder :)


这篇关于在母版页中无法使面板可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆