Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8074843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:47:26+00:00 2026-06-05T14:47:26+00:00

I’m new in ASP.Net and I want to creat a very simple form which

  • 0

I’m new in ASP.Net and I want to creat a very simple form which bind to a master page but no success. this is my Master Page code:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder ID="HeadContent" runat="server" /> 
</head>
<body>
<form runat=server>
<asp:ContentPlaceHolder ID="MainContent" runat="server">
  <body>
   <table width=100% border=1 style="background:black" >
    <tr>
      <td width=20%></td>
      <td width=80%><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></td>
      <td width=20%></td>
    </tr>
   </table>
  </body>
 </asp:ContentPlaceHolder>
</form>

</body>
</html>

and code of my page is:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<asp:Content ContentPlaceHolderID=HeadContent runat=server>
</asp:Content>   

<asp:Content ID="MainContent" runat=server ContentPlaceHolderID=MainContent >
</asp:Content>

but hte table in the Master Page doesn’t appear in the page.Would you please help me to solve this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T14:47:29+00:00Added an answer on June 5, 2026 at 2:47 pm

    For starters,

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <asp:Content ContentPlaceHolderID=HeadContent runat=server>
    </asp:Content>   
    
    <asp:Content ID="MainContent" runat=server ContentPlaceHolderID=MainContent >
    </asp:Content>
    

    is entirely wrong.

    The DOCTYPE should be listed in the master. Secondly:

    <asp:Content ID="HContent" ContentPlaceHolderID="HeadContent" runat="server">
    </asp:Content>
    
    <asp:Content ID="MainContent" runat="server" ContentPlaceHolderID="MainContent" >
    </asp:Content>
    

    Would more closely match your intent. But one flaw in your style, as it were, and this is strictly a style thing:

    <asp:Content ID="HContent" ContentPlaceHolderID="HeadContent" runat="server" >
    </asp:Content>
    
    <asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="server" >
    </asp:Content>
    

    Notice how I put runat="server" at the end, on both tags? Always put that at the end, it’ll make it easier to make sure you’ve put it in the right place. Alternately, always put it right before ID


    Edit:

    <asp:ContentPlaceHolder ID="MainContent" runat="server">
      <body>
       <table width=100% border=1 style="background:black" >
        <tr>
          <td width=20%></td>
          <td width=80%><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></td>
          <td width=20%></td>
        </tr>
       </table>
      </body>
     </asp:ContentPlaceHolder>
    

    Where you have this in the master page, the contents of the ContentPlaceHolder won’t be shown when a child page implements this section. You’ll need to move those outside of the master page ContentPlaceHolder declaration. This concept is very "either or" and there is no room to have an alternate opinion. It was written this way on purpose.

    Perhaps you want:

    <asp:ContentPlaceHolder ID="MainContent" runat="server" />
    <body>
     <table width=100% border=1 style="background:black" >
      <tr>
        <td width=20%></td>
        <td width=80%><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></td>
        <td width=20%></td>
      </tr>
     </table>
    </body>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
I have a text area in my form which accepts all possible characters from
I want to construct a data frame in an Rcpp function, but when I
I'm making a simple page using Google Maps API 3. My first. One marker
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.