Click here to Skip to main content
16,018,458 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Master Page Link Button not display in the content Page?
Posted
Comments
Sandeep Mewara 29-Jun-10 2:28am    
What do you mean by not display? What are you trying? Where is it not visible? UI or Codebehind?

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">
 
Share this answer
 
v5
Comments
DaveAuld 29-Jun-10 2:37am    
Sorry its not formatted nicely, but still problems with pasting code and html encoding etc.
DaveAuld 29-Jun-10 4:15am    
DD - I gave up trying to format it, there is something a miss somewhere with QAs.......
Dalek Dave 29-Jun-10 4:17am    
I tried code and inline, moving the tags and gave up too! :)

Did you mention this in SiteBugs?
DaveAuld 29-Jun-10 4:18am    
I am sure there is a reference to the issue somewhere already, there has been that much in SB+S's lately that i think it is a few pages back now.
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


XML
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>
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900