general question

Discussion in 'ASP .Net' started by =?Utf-8?B?QW5kcmV3?=, Aug 30, 2005.

  1. In asp I could attach this tag as example below to join asp pages together in
    a single page.

    <!-- File: header1.html -->

    <!-- File: footer1.html -->

    Is it possible to do this in asp.net ? If so, how do I do it ?

    TIA. Cheers.
    Andrew
    =?Utf-8?B?QW5kcmV3?=, Aug 30, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?QW5kcmV3?=

    Hans Kesting Guest

    Andrew wrote:
    > In asp I could attach this tag as example below to join asp pages
    > together in a single page.
    >
    > <!-- File: header1.html -->
    >
    > <!-- File: footer1.html -->
    >
    > Is it possible to do this in asp.net ? If so, how do I do it ?
    >
    > TIA. Cheers.
    > Andrew


    I'm not certain that it is really impossible, but the *recommended* way
    is to use Web User Controls (ascx files) for "standard blocks".

    You can then design a header (or footer or other block) in a separate file,
    *including* code-behind. Then you can drag this control onto the aspx
    page (or even another ascx).

    Hans Kesting
    Hans Kesting, Aug 30, 2005
    #2
    1. Advertising

  3. Hi Andrew

    I think what you're looking for are user controls

    If you add a user control to your project add some code/HTML/text then you
    can drag and drop the user control (the .ASCX file) on to any .ASPX page in
    your project. It will appear as a grey box in the designer but once you run
    it it will appear.

    For more on user controls
    http://www.dotnetjunkies.com/quickstart/aspplus/doc/webpagelets.aspx

    Cheers

    Felix
    =?Utf-8?B?Rng=?=, Aug 30, 2005
    #3
  4. thanks

    "Fx" wrote:

    > Hi Andrew
    >
    > I think what you're looking for are user controls
    >
    > If you add a user control to your project add some code/HTML/text then you
    > can drag and drop the user control (the .ASCX file) on to any .ASPX page in
    > your project. It will appear as a grey box in the designer but once you run
    > it it will appear.
    >
    > For more on user controls
    > http://www.dotnetjunkies.com/quickstart/aspplus/doc/webpagelets.aspx
    >
    > Cheers
    >
    > Felix
    =?Utf-8?B?QW5kcmV3?=, Aug 30, 2005
    #4
  5. =?Utf-8?B?QW5kcmV3?=

    tom pester Guest

    That include file syntax is still supported.

    User control's are the more asp.NET way to do it but you don't have too.

    HTH

    Cheers,
    Tom Pester

    > Andrew wrote:
    >
    >> In asp I could attach this tag as example below to join asp pages
    >> together in a single page.
    >>
    >> <!-- File: header1.html -->
    >>
    >> <!-- File: footer1.html -->
    >>
    >> Is it possible to do this in asp.net ? If so, how do I do it ?
    >>
    >> TIA. Cheers.
    >> Andrew

    > I'm not certain that it is really impossible, but the *recommended*
    > way is to use Web User Controls (ascx files) for "standard blocks".
    >
    > You can then design a header (or footer or other block) in a separate
    > file,
    > *including* code-behind. Then you can drag this control onto the aspx
    > page (or even another ascx).
    > Hans Kesting
    >
    tom pester, Aug 30, 2005
    #5
  6. > In asp I could attach this tag as example below to join asp pages together
    > in
    > a single page.
    >
    > <!-- File: header1.html -->
    >
    > <!-- File: footer1.html -->
    >
    > Is it possible to do this in asp.net ? If so, how do I do it ?


    First, it is not possible to do what you described using HTML comments,
    which is what those are. The only way to "join asp pages together in a
    single page is by using server-side includes.

    If that is what you're asking about, the answer is, yes, it's possible, but
    breaks the ASP.Net object-oriented programming model.

    Bottom line is, if you want to program procedurally, use ASP. If you want to
    use ASP.Net, learn object-oriented programming, and learn the ASP.Net OOP
    way of developing web applications. ASP will continue to be supported for
    many years to come. ASP.Net is quite a learning curve to surmount, and is
    well worth the effort, but you must be willing to make the effort to use it
    correctly, or you will be very disappointed in the long run.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    Neither a follower nor a lender be.

    "Andrew" <> wrote in message
    news:...
    > In asp I could attach this tag as example below to join asp pages together
    > in
    > a single page.
    >
    > <!-- File: header1.html -->
    >
    > <!-- File: footer1.html -->
    >
    > Is it possible to do this in asp.net ? If so, how do I do it ?
    >
    > TIA. Cheers.
    > Andrew
    >
    Kevin Spencer, Aug 30, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jolly Student

    General .Net Question

    Jolly Student, Jun 11, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    426
    Jolly Student
    Jun 11, 2004
  2. Adrian Herscu

    General .NET question

    Adrian Herscu, Feb 25, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    399
    Anand N [MVP]
    Feb 28, 2005
  3. Smkmdb1

    Beginner's General Question

    Smkmdb1, Aug 17, 2003, in forum: ASP .Net
    Replies:
    6
    Views:
    349
    Jason \(MFT1\)
    Aug 18, 2003
  4. Vlad

    ViewState general question

    Vlad, Dec 24, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    380
    Victor Garcia Aprea [MVP]
    Dec 27, 2003
  5. Robin
    Replies:
    2
    Views:
    108
    richard
    Feb 23, 2011
Loading...

Share This Page