母版页链接按钮未显示在内容页中吗? [英] Master Page Link Button not display in the content Page?

查看:92
本文介绍了母版页链接按钮未显示在内容页中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

母版页面链接按钮未显示在内容页面中吗?

Master Page Link Button not display in the content Page?

推荐答案

对不起,您的问题不明白,不是很清楚.

内容页面必须放置在母版页的ContentPlaceHolder中.检查您是否正确设置了内容占位符和内容页面以及正确引用的母版页.检查内容页面顶部的页面指令.请参阅以下文本,作为每个母版页和内容页的基础示例;

母版页基本来源;

Sorry, don''t understand your question, it is not very clear.

The content page, must be placed in a ContentPlaceHolder within master page. Check you have setup your content placeholder and content pages correctly, with properly referenced master page. Check the Page Directives at the top of the content page. See the text below as examples of the Basics for Each Master and Content Page;

Master Page Basic Source;

<%@ Master Language="VB" CodeFile="MasterPage.master.vb" 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></title>
    <asp:ContentPlaceHolder id="head" runat="server">
    
</head>
<body>
    <form id="form1"  runat="server">
    
    The Master Page Button;<asp:Button ID="Button1" runat="server" Text="Button" />
    </form>
    <div>
        the content place holder;
        <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
        
        
    </div>
</body>
</html>


内容页面来源;


Content Page Source;

<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %>

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

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">


如果您在代码中注意到的第一件事是,在按钮标签关闭之后,结束了表单标签.只需剪切</form>从现在的位置添加标签,然后将其粘贴到</body>末尾之前标签.会工作的...


像下面的代码


First thing if you notice in your code is that the form tag is ending after the button tag closes. just cut the </form> tag from the place where it is now and paste it before the end of the </body> tag. it would work...


like below code


Master Page Basic Source;
<%@ Master Language="VB" CodeFile="MasterPage.master.vb" 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></title>
      <asp:ContentPlaceHolder id="head" runat="server">
      </asp:ContentPlaceHolder>
</head>
<body>
      <form id="form1" runat="server">
      The Master Page Button;<asp:Button ID="Button1" runat="server" Text="Button" />
     
      <div><code></code>
            the content place holder;
            <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
            </asp:ContentPlaceHolder>
      </div>&amp;amp;lt;/form&amp;amp;gt;
</body> 
</html>


这篇关于母版页链接按钮未显示在内容页中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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