CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 3 of 3

Thread: About Content code at top of the aspx page

  1. #1
    Join Date
    Sep 2014

    About Content code at top of the aspx page


    At the top of my aspx page, I have

    <%@ Page Language="VB" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="success_test1.aspx.vb" Inherits="Success_test1" %>
    followed by:

    <asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    Is that correct, please, or is it this:

    <asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    Would that be the same for my other aspx files in the same Solution Explorer project?

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004

    Re: About Content code at top of the aspx page

    I know this isn't an answer to your question but why are you coding in old asp? What version of Visual Studio are you using?

    I ask because if you are starting a new web project, there are many newer ways to go such as .Net Core, MVC, Angular, React and so on.

    On the other hand, if you have an existing asp application with other pages, you should be able to answer your own question by looking at how the other pages are coded.

    If at all possible, there are many benefits to moving away from the 15 year old technology.

  3. #3
    Join Date
    Sep 2014

    Re: About Content code at top of the aspx page

    Thanks Arjay for your reply.

    I am using ASP.NET in Visual Studio 2017 (latest version). It's a Web Forms project.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)