MasterPage changing Content Page

Discussion in 'ASP .Net' started by pvong, Nov 28, 2008.

  1. pvong

    pvong Guest

    Doing this in VB.NET

    This is my first attempt and it didn't work. I have a simple master page
    with a DropDownList. All I want it to do is if DropDownList SelectedValue =
    "2" then the content page opens up another page. I hope this makes sense.
    Anyway, this was my code:

    Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object,
    ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged

    If DropDownList1.SelectedValue = "2" Then

    ContentPlaceHolder1.ResolveUrl("http://somesite.com")

    End If

    End Sub
     
    pvong, Nov 28, 2008
    #1
    1. Advertising

  2. pvong

    Hillbilly Guest

    Go into design view and double-click on the DropDownList control. Visual
    Studio will generate an event handler in your .vb file. In that event
    handler write your code to navigate to the page you want using one of
    several means to transfer control to a new page; Transfer or Redirect
    depening on how you want to handle the URL displayed in the browser's
    address bar. The other stuff Rae discussed I tend to agree with except to
    note MasterPage is not a user control but a type of user control as there is
    a difference between "is a" and "type of". The use of an iFrame is not
    needed.

    That said, if you actually want to load the same content page using a
    different look and feel you will need to call itself using a different
    MasterPage which must be done using a base class so you can access the
    Page_PreLoad event otherwise not accessible to the MasterPage or the Content
    Page because Master is a "type of" User Control as I've made a brief attempt
    to clarify.


    "Mark Rae [MVP]" <> wrote in message
    news:...
    > "pvong" <phillip*at*yahoo*dot*com> wrote in message
    > news:...
    >
    >> This is my first attempt and it didn't work. I have a simple master page
    >> with a DropDownList. All I want it to do is if DropDownList
    >> SelectedValue = "2" then the content page opens up another page. I hope
    >> this makes sense. Anyway, this was my code:
    >>
    >> Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object,
    >> ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
    >>
    >> If DropDownList1.SelectedValue = "2" Then
    >>
    >> ContentPlaceHolder1.ResolveUrl("http://somesite.com")

    >
    > You're making the classic mistake of assuming that MasterPages are somehow
    > the ASP.NET equivalent of framesets. They're not. In fact, MasterPages are
    > nothing more than UserControls. The term "MasterPage" is very misleading -
    > if Microsoft had called them TemplateControls or LayoutControls, that
    > would have made much more sense IMO...
    >
    > A MasterPage doesn't change content pages. When a content page opens, it
    > opens any MasterPage(s) referenced on it and then merges the MasterPage's
    > markup into its own to form a single page. When a content page loads, it
    > reloads the MasterPage every time.
    >
    > To answer your specific question, it looks like you're trying to show the
    > contents of a remote URL. To do this, I'd suggest using an iframe in the
    > content page and set its url dynamically when the page loads, either by
    > passing a querystring or setting a session variable, e.g.
    >
    > If DropDownList1.SelectedValue = "2" Then
    > Response.Redirect("MyContentPage.aspx"?ID=2
    > End If
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net
     
    Hillbilly, Nov 28, 2008
    #2
    1. Advertising

  3. "Mark Rae [MVP]" <> a écrit dans le message de groupe
    de discussion : OFTg6$...
    > "Hillbilly" <> wrote in message
    > news:%...
    >
    >> The other stuff Rae discussed I tend to agree with except to note
    >> MasterPage is not a user control but a type of user control as there is a
    >> difference between "is a" and "type of".

    >
    > Ignore the above - a MasterPage is a UserControl.


    A more detailed answer could be that OO design is based on the assumption
    that any (sub)Type of X is an X (see Liskov Substitution Principle).
     
    Christophe Lephay, Nov 28, 2008
    #3
  4. pvong

    Hillbilly Guest

    Yes, I mispoke when stating Page_PreLoad when in fact the event is
    Page_PreInit which brings me to ask for clarification from those who
    proclaim themselves as experts --must-- we use a base class and Page_PreInit
    to access and change properties of a User Control in a Content Page when
    using a MasterPage?


    "Mark Rae [MVP]" <> wrote in message
    news:...
    > "Christophe Lephay" <> wrote in message
    > news:...
    >
    >>>> The other stuff Rae discussed I tend to agree with except to note
    >>>> MasterPage is not a user control but a type of user control as there is
    >>>> a difference between "is a" and "type of".
    >>>
    >>> Ignore the above - a MasterPage is a UserControl.

    >>
    >> A more detailed answer could be that OO design is based on the assumption
    >> that any (sub)Type of X is an X (see Liskov Substitution Principle).

    >
    > Indeed. The statement "MasterPage is not a user control but a type of user
    > control" is just plain ludicrous...
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net
     
    Hillbilly, Nov 29, 2008
    #4
  5. pvong

    Hillbilly Guest

    Hello Christophe.
    Is a dog also a human being because we both have legs or are we both a type
    of mammal?

    "Christophe Lephay" <> wrote in message
    news:...
    > "Mark Rae [MVP]" <> a écrit dans le message de
    > groupe de discussion : OFTg6$...
    >> "Hillbilly" <> wrote in message
    >> news:%...
    >>
    >>> The other stuff Rae discussed I tend to agree with except to note
    >>> MasterPage is not a user control but a type of user control as there is
    >>> a difference between "is a" and "type of".

    >>
    >> Ignore the above - a MasterPage is a UserControl.

    >
    > A more detailed answer could be that OO design is based on the assumption
    > that any (sub)Type of X is an X (see Liskov Substitution Principle).
     
    Hillbilly, Nov 29, 2008
    #5
  6. [OT]Re: MasterPage changing Content Page

    "Hillbilly" <> a écrit dans le message de groupe de
    discussion : #...
    > Hello Christophe.
    > Is a dog also a human being because we both have legs or are we both a
    > type of mammal?


    Hey, nothing personal, i just wanted to say something about "a MasterPage is
    a UserControl"...

    .... with the secret wish to avoid polemics.

    My bad ;)

    "Is" has a lot of different meanings. In OO stuff, it means something
    specific, and i was hoping that reminding this specific meaning could help
    everybody to agree.

    > "Christophe Lephay" <> wrote in message
    > news:...
    >> "Mark Rae [MVP]" <> a écrit dans le message de
    >>> a MasterPage is a UserControl.

    >>
    >> A more detailed answer could be that OO design is based on the assumption
    >> that any (sub)Type of X is an X (see Liskov Substitution Principle).
     
    Christophe Lephay, Nov 29, 2008
    #6
  7. pvong

    George Guest

    "Hillbilly" <> wrote in message
    news:%...
    > Hello Christophe.
    > Is a dog also a human being because we both have legs or are we both a
    > type of mammal?
    >
    > "Christophe Lephay" <> wrote in message
    > news:...
    >> "Mark Rae [MVP]" <> a écrit dans le message de
    >> groupe de discussion : OFTg6$...
    >>> "Hillbilly" <> wrote in message
    >>> news:%...
    >>>
    >>>> The other stuff Rae discussed I tend to agree with except to note
    >>>> MasterPage is not a user control but a type of user control as there is
    >>>> a difference between "is a" and "type of".
    >>>
    >>> Ignore the above - a MasterPage is a UserControl.

    >>
    >> A more detailed answer could be that OO design is based on the assumption
    >> that any (sub)Type of X is an X (see Liskov Substitution Principle).

    >


    Accroding to the C# language
    if (MasterPage is UserControl)
    will evaluate to true... So MasterPage is a UserControl :)

    And (from MSDN) the hierarchy goes.
    System.Object
    System.Web.UI.Control
    System.Web.UI.TemplateControl
    System.Web.UI.UserControl
    System.Web.UI.MasterPage


    Not sure about dogs being humans :)


    George.
     
    George, Nov 30, 2008
    #7
  8. pvong

    Hillbilly Guest

    I am formally educated, degreed and an experienced architect. On the basis
    of my training if I were to make decisions on what is mearly implied as you
    all have done in this matter by continually referring to nothing more than
    the a listed item in an inheritance tree people could lose their lives.

    Therefore I have been compelled to become a strict constructionist. Other
    than the fact that the MasterPage and the User Control both inherit from the
    Template Control Class I have yet to read one word of official documentation
    that explicitly states the MasterPage --is a-- User Control. Furthermore,
    there is so much documentation stating otherwise not to mention how
    different each is in usage that I have been surprised people continue to
    insist on claiming --is a-- rather then the more correct --type of--
    description.

    I'm going to write to Scott Gu and ask him if he will finally blog on this
    matter as it keeps coming up.


    "George" <> wrote in message
    news:...
    > "Hillbilly" <> wrote in message
    > news:%...
    >> Hello Christophe.
    >> Is a dog also a human being because we both have legs or are we both a
    >> type of mammal?
    >>
    >> "Christophe Lephay" <> wrote in message
    >> news:...
    >>> "Mark Rae [MVP]" <> a écrit dans le message de
    >>> groupe de discussion : OFTg6$...
    >>>> "Hillbilly" <> wrote in message
    >>>> news:%...
    >>>>
    >>>>> The other stuff Rae discussed I tend to agree with except to note
    >>>>> MasterPage is not a user control but a type of user control as there
    >>>>> is a difference between "is a" and "type of".
    >>>>
    >>>> Ignore the above - a MasterPage is a UserControl.
    >>>
    >>> A more detailed answer could be that OO design is based on the
    >>> assumption that any (sub)Type of X is an X (see Liskov Substitution
    >>> Principle).

    >>

    >
    > Accroding to the C# language
    > if (MasterPage is UserControl)
    > will evaluate to true... So MasterPage is a UserControl :)
    >
    > And (from MSDN) the hierarchy goes.
    > System.Object
    > System.Web.UI.Control
    > System.Web.UI.TemplateControl
    > System.Web.UI.UserControl
    > System.Web.UI.MasterPage
    >
    >
    > Not sure about dogs being humans :)
    >
    >
    > George.
    >
    >
    >
     
    Hillbilly, Nov 30, 2008
    #8
  9. pvong

    George Guest

    MasterPage inherits UserControl (which in turn inherits TemplateControl).
    http://msdn.microsoft.com/en-us/library/system.web.ui.masterpage.aspx


    It's like every human is mamal but not every mamal is human.
    Same here. MasterPage is UserControl but not every UserControl is
    MasterPage.


    George.

    "Hillbilly" <> wrote in message
    news:ux1i%...
    >I am formally educated, degreed and an experienced architect. On the basis
    >of my training if I were to make decisions on what is mearly implied as you
    >all have done in this matter by continually referring to nothing more than
    >the a listed item in an inheritance tree people could lose their lives.
    >
    > Therefore I have been compelled to become a strict constructionist. Other
    > than the fact that the MasterPage and the User Control both inherit from
    > the Template Control Class I have yet to read one word of official
    > documentation that explicitly states the MasterPage --is a-- User Control.
    > Furthermore, there is so much documentation stating otherwise not to
    > mention how different each is in usage that I have been surprised people
    > continue to insist on claiming --is a-- rather then the more
    > correct --type of-- description.
    >
    > I'm going to write to Scott Gu and ask him if he will finally blog on this
    > matter as it keeps coming up.
    >
    >
    > "George" <> wrote in message
    > news:...
    >> "Hillbilly" <> wrote in message
    >> news:%...
    >>> Hello Christophe.
    >>> Is a dog also a human being because we both have legs or are we both a
    >>> type of mammal?
    >>>
    >>> "Christophe Lephay" <> wrote in message
    >>> news:...
    >>>> "Mark Rae [MVP]" <> a écrit dans le message de
    >>>> groupe de discussion : OFTg6$...
    >>>>> "Hillbilly" <> wrote in message
    >>>>> news:%...
    >>>>>
    >>>>>> The other stuff Rae discussed I tend to agree with except to note
    >>>>>> MasterPage is not a user control but a type of user control as there
    >>>>>> is a difference between "is a" and "type of".
    >>>>>
    >>>>> Ignore the above - a MasterPage is a UserControl.
    >>>>
    >>>> A more detailed answer could be that OO design is based on the
    >>>> assumption that any (sub)Type of X is an X (see Liskov Substitution
    >>>> Principle).
    >>>

    >>
    >> Accroding to the C# language
    >> if (MasterPage is UserControl)
    >> will evaluate to true... So MasterPage is a UserControl :)
    >>
    >> And (from MSDN) the hierarchy goes.
    >> System.Object
    >> System.Web.UI.Control
    >> System.Web.UI.TemplateControl
    >> System.Web.UI.UserControl
    >> System.Web.UI.MasterPage
    >>
    >>
    >> Not sure about dogs being humans :)
    >>
    >>
    >> George.
    >>
    >>
    >>

    >
     
    George, Nov 30, 2008
    #9
  10. pvong

    Hillbilly Guest

    Yea, I understand you are still referencing the Inheritance tree diagram
    which I think may be wrong for the following reasons primarily there is not
    other documentation that explicitly states the MasterPage is derived from
    UserControl --but-- there is explicit language that states the MasterPage
    class is derived from the Page class which is what TemplateControl does.

    [1] Remarks Par. 3:
    The resulting compiled, merged class (MasterPage) derives from the Page
    class.

    [1] Remarks Par. 8:
    The master page is made available to the content page through the Master
    property of the base Page class.

    [2] TemplateControl Class
    Provides the Page class and the UserControl class with a base set of
    functionality.

    Q: Why does the MasterPage have to inherit the Page class when the
    TemplateControl class provides the functionality to the MasterPage class as
    the documentation explains in writing in several locations?

    Q: Why does the documentation for TemplateControl not also mention the
    MasterPage class which also derives its functionality from the Page class?

    My argument has been there is what we call an "error and omission" and in
    the real world there is actually insurance that can be purchased to pay for
    the results of these types of errors and omissions when an architect is
    simply following the documentation as it is expressed IN WRITING --not-- a
    DIAGRAM as the Inheritance tree diagram would be defined in a court of law
    where these matters would have to be resolved when the architect misplaces
    his or her trust in an assumed trustworthy source only to discover at some
    point in time after somebody has the roof fall on their head that there was
    in fact an error and omission due to perhaps laziness or some other
    generally understood observation of documentation that is contradictory.

    The assertion here is basic and fundamental: there is no reason the
    MasterPage needs to inherit the User Control to inherit the Page class when
    the TemplateControl class makes the Page class available directly.

    This is what I mean by strict constructionist. The documentation is either
    trustworthy prima facie or it is not trustworthy. As I have shown three
    contradictions of proof it must be concluded the documentation --is not
    trustworthy prima facie-- which the authors have an obligation to clarify.

    It is entirely possible and error has been made since there is clearly
    documentation that contradicts the Inheritance tree diagram implying the
    diagram itself may be incorrect and its the diagram and only the diagram
    that most of you have relied on yet I have shown three proofs that
    contradict the diagram. Its entirely possible the persons writing these
    documentation pages simply did not know or did not care to use the correct
    statement for the tree control used to generate that specific Inheritance
    tree diagram is it not? This is my assertion.

    Finally, I am no wizard at using reflection but given the time it would be
    useful to fire up Roeder's tool and read the IL which I continue to think
    will show no sign of the User Control class when a master page is being
    compiled.


    [1] http://msdn.microsoft.com/en-us/library/system.web.ui.masterpage.aspx
    [2]
    http://msdn.microsoft.com/en-us/library/system.web.ui.templatecontrol.aspx


    "George" <> wrote in message
    news:...
    > MasterPage inherits UserControl (which in turn inherits TemplateControl).
    > http://msdn.microsoft.com/en-us/library/system.web.ui.masterpage.aspx
    >
    >
    > It's like every human is mamal but not every mamal is human.
    > Same here. MasterPage is UserControl but not every UserControl is
    > MasterPage.
    >
    >
    > George.
    >
    > "Hillbilly" <> wrote in message
    > news:ux1i%...
    >>I am formally educated, degreed and an experienced architect. On the basis
    >>of my training if I were to make decisions on what is mearly implied as
    >>you all have done in this matter by continually referring to nothing more
    >>than the a listed item in an inheritance tree people could lose their
    >>lives.
    >>
    >> Therefore I have been compelled to become a strict constructionist. Other
    >> than the fact that the MasterPage and the User Control both inherit from
    >> the Template Control Class I have yet to read one word of official
    >> documentation that explicitly states the MasterPage --is a-- User
    >> Control. Furthermore, there is so much documentation stating otherwise
    >> not to mention how different each is in usage that I have been surprised
    >> people continue to insist on claiming --is a-- rather then the more
    >> correct --type of-- description.
    >>
    >> I'm going to write to Scott Gu and ask him if he will finally blog on
    >> this matter as it keeps coming up.
    >>
    >>
    >> "George" <> wrote in message
    >> news:...
    >>> "Hillbilly" <> wrote in message
    >>> news:%...
    >>>> Hello Christophe.
    >>>> Is a dog also a human being because we both have legs or are we both a
    >>>> type of mammal?
    >>>>
    >>>> "Christophe Lephay" <> wrote in message
    >>>> news:...
    >>>>> "Mark Rae [MVP]" <> a écrit dans le message de
    >>>>> groupe de discussion : OFTg6$...
    >>>>>> "Hillbilly" <> wrote in message
    >>>>>> news:%...
    >>>>>>
    >>>>>>> The other stuff Rae discussed I tend to agree with except to note
    >>>>>>> MasterPage is not a user control but a type of user control as there
    >>>>>>> is a difference between "is a" and "type of".
    >>>>>>
    >>>>>> Ignore the above - a MasterPage is a UserControl.
    >>>>>
    >>>>> A more detailed answer could be that OO design is based on the
    >>>>> assumption that any (sub)Type of X is an X (see Liskov Substitution
    >>>>> Principle).
    >>>>
    >>>
    >>> Accroding to the C# language
    >>> if (MasterPage is UserControl)
    >>> will evaluate to true... So MasterPage is a UserControl :)
    >>>
    >>> And (from MSDN) the hierarchy goes.
    >>> System.Object
    >>> System.Web.UI.Control
    >>> System.Web.UI.TemplateControl
    >>> System.Web.UI.UserControl
    >>> System.Web.UI.MasterPage
    >>>
    >>>
    >>> Not sure about dogs being humans :)
    >>>
    >>>
    >>> George.
    >>>
    >>>
    >>>

    >>

    >
     
    Hillbilly, Dec 1, 2008
    #10
  11. pvong

    pvong Guest

    Glad I can bring a healthy discussion to the table. You guys are obviously
    experts and are way over my head. I went with what Mark said and used
    iFrames.


    "pvong" <phillip*at*yahoo*dot*com> wrote in message
    news:...
    > Doing this in VB.NET
    >
    > This is my first attempt and it didn't work. I have a simple master page
    > with a DropDownList. All I want it to do is if DropDownList SelectedValue
    > = "2" then the content page opens up another page. I hope this makes
    > sense. Anyway, this was my code:
    >
    > Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object,
    > ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
    >
    > If DropDownList1.SelectedValue = "2" Then
    >
    > ContentPlaceHolder1.ResolveUrl("http://somesite.com")
    >
    > End If
    >
    > End Sub
    >
    >
     
    pvong, Dec 1, 2008
    #11
  12. pvong

    Hillbilly Guest

    iFrames are ca-ca and you will regret using iFrames. Google iFrames using
    different terms for the words good and bad and then make up your mind...

    What you asked about is simple. Just give the directions I suggested on
    11/28 a try or you'll never get the hang of this if you can't do something
    as simple as follow directions and click as instructed. I'll keep walking
    you through if you need more help...


    "pvong" <phillip*at*yahoo*dot*com> wrote in message
    news:...
    > Glad I can bring a healthy discussion to the table. You guys are
    > obviously experts and are way over my head. I went with what Mark said
    > and used iFrames.
    >
    >
    > "pvong" <phillip*at*yahoo*dot*com> wrote in message
    > news:...
    >> Doing this in VB.NET
    >>
    >> This is my first attempt and it didn't work. I have a simple master page
    >> with a DropDownList. All I want it to do is if DropDownList
    >> SelectedValue = "2" then the content page opens up another page. I hope
    >> this makes sense. Anyway, this was my code:
    >>
    >> Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object,
    >> ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
    >>
    >> If DropDownList1.SelectedValue = "2" Then
    >>
    >> ContentPlaceHolder1.ResolveUrl("http://somesite.com")
    >>
    >> End If
    >>
    >> End Sub
    >>
    >>

    >
    >
     
    Hillbilly, Dec 2, 2008
    #12
  13. pvong

    pvong Guest

    Hillbilly - I'm willing to take a stab at this if you're willing to help.
    Please note I'm still a newbie at this. I'm doing all this in vb.net.

    - The reason why I'm thinking I had to use iFrames is:
    Every night, a 3rd party software generates a plain old .htm file. So this
    file deletes and creates a new .htm file every night. From reading the
    discussion you guys had, I've come to the conclusion that a Content Page is
    actually the main page and the Master Page is just like a wrapper that wraps
    around the Content page. I know I'm not talking in official programmers
    languauge, but I'm a newbie so I have to talk about it in simple form so I
    can understand. So, if a 3rd party program is creating this htm file every
    night, it does not know that it's going to be a part of the MasterPage so it
    can never be a Content Page, right? Then I'm stuck with iFrame, right?

    -If I'm wrong, how can a simple plain htm from a 3rd party software load in
    a Content Page?

    Thanks!
    Phil
     
    pvong, Dec 2, 2008
    #13
  14. pvong

    Hillbilly Guest

    Basically right but I need some preliminary information. For example answer
    the following yes or no questions...

    Q. Do you have any control of the .htm file at all?

    Q. Is it possible to have the 3rd party software program save the file
    without the following tags sets: <html>, <head>, <title>, and <body>?

    Q. Is it possible to have the file saved to a different file extenstion:
    ..inc or .asp?

    Q. Do you know what an HTML include directive is?

    Q. Do you know what an ASP.NET User Control is yet?

    Q. Did you ever do any mechanical or architectural drafting in school, for a
    hobby or for employment?




    "pvong" <phillip*at*yahoo*dot*com> wrote in message
    news:...
    > Hillbilly - I'm willing to take a stab at this if you're willing to help.
    > Please note I'm still a newbie at this. I'm doing all this in vb.net.
    >
    > - The reason why I'm thinking I had to use iFrames is:
    > Every night, a 3rd party software generates a plain old .htm file. So
    > this file deletes and creates a new .htm file every night. From reading
    > the discussion you guys had, I've come to the conclusion that a Content
    > Page is actually the main page and the Master Page is just like a wrapper
    > that wraps around the Content page. I know I'm not talking in official
    > programmers languauge, but I'm a newbie so I have to talk about it in
    > simple form so I can understand. So, if a 3rd party program is creating
    > this htm file every night, it does not know that it's going to be a part
    > of the MasterPage so it can never be a Content Page, right? Then I'm
    > stuck with iFrame, right?
    >
    > -If I'm wrong, how can a simple plain htm from a 3rd party software load
    > in a Content Page?
    >
    > Thanks!
    > Phil
    >
    >
     
    Hillbilly, Dec 5, 2008
    #14
  15. pvong

    pvong Guest

    "Hillbilly" <> wrote in message
    news:...
    > Basically right but I need some preliminary information. For example
    > answer the following yes or no questions...
    >
    > Q. Do you have any control of the .htm file at all?

    NO
    >
    > Q. Is it possible to have the 3rd party software program save the file
    > without the following tags sets: <html>, <head>, <title>, and <body>?

    NO
    >
    > Q. Is it possible to have the file saved to a different file extenstion:
    > .inc or .asp?

    NO
    >
    > Q. Do you know what an HTML include directive is?

    NO
    >
    > Q. Do you know what an ASP.NET User Control is yet?

    YES
    >
    > Q. Did you ever do any mechanical or architectural drafting in school, for
    > a hobby or for employment?

    NO. I was an accounting major and I'm currently the CFO and help run a
    $100mn mutual fund company. Programming is my hobby and not my profession
    and it can never be. Just because it can never be my profession does not
    mean I don't want to learn more about my hobby.

    SO - Am I right to think I need to stick with iFrame since I have no control
    of the output from this other software? It's always going to generate an
    htm file. I know I can probably write some kind of program that will break
    the file down, but it may not be worth it since it's repeated everynight and
    the htm is fine the way it is. It's just not built for Mastpage scenerio.
    >
    >
    >
    >
    > "pvong" <phillip*at*yahoo*dot*com> wrote in message
    > news:...
    >> Hillbilly - I'm willing to take a stab at this if you're willing to help.
    >> Please note I'm still a newbie at this. I'm doing all this in vb.net.
    >>
    >> - The reason why I'm thinking I had to use iFrames is:
    >> Every night, a 3rd party software generates a plain old .htm file. So
    >> this file deletes and creates a new .htm file every night. From reading
    >> the discussion you guys had, I've come to the conclusion that a Content
    >> Page is actually the main page and the Master Page is just like a wrapper
    >> that wraps around the Content page. I know I'm not talking in official
    >> programmers languauge, but I'm a newbie so I have to talk about it in
    >> simple form so I can understand. So, if a 3rd party program is creating
    >> this htm file every night, it does not know that it's going to be a part
    >> of the MasterPage so it can never be a Content Page, right? Then I'm
    >> stuck with iFrame, right?
    >>
    >> -If I'm wrong, how can a simple plain htm from a 3rd party software load
    >> in a Content Page?
    >>
    >> Thanks!
    >> Phil
    >>
    >>

    >
     
    pvong, Dec 7, 2008
    #15
  16. On Sat, 29 Nov 2008 10:53:54 -0600, "Hillbilly"
    <> wrote:

    >Hello Christophe.
    >Is a dog also a human being because we both have legs or are we both a type
    >of mammal?


    Don't confuse the regular use of a term (in this case "is a") with
    it's technical uses in particular contexts.

    If dog, mammal and humanBeing are OO classes, then

    In OO terms, a dog "is a" mammal, and a humanBeing "is a" mammal.

    This is pretty standard terminology, i.e.:

    type A "is a" "type B" means "type A is the same as type B or type A
    is a sub class of type B".

    MasterPage subclasses UserControl, and so a MasterPage "is a"
    UserControl.



    >"Christophe Lephay" <> wrote in message
    >news:...
    >> "Mark Rae [MVP]" <> a écrit dans le message de
    >> groupe de discussion : OFTg6$...
    >>> "Hillbilly" <> wrote in message
    >>> news:%...
    >>>
    >>>> The other stuff Rae discussed I tend to agree with except to note
    >>>> MasterPage is not a user control but a type of user control as there is
    >>>> a difference between "is a" and "type of".
    >>>
    >>> Ignore the above - a MasterPage is a UserControl.

    >>
    >> A more detailed answer could be that OO design is based on the assumption
    >> that any (sub)Type of X is an X (see Liskov Substitution Principle).

    --
    http://www.sgat-computing-services.co.uk/
     
    Gareth Erskine-Jones, Dec 7, 2008
    #16
  17. On Sun, 30 Nov 2008 12:16:49 -0600, "Hillbilly"
    <> wrote:

    >I am formally educated, degreed and an experienced architect. On the basis
    >of my training if I were to make decisions on what is mearly implied as you
    >all have done in this matter by continually referring to nothing more than
    >the a listed item in an inheritance tree people could lose their lives.
    >
    >Therefore I have been compelled to become a strict constructionist. Other
    >than the fact that the MasterPage and the User Control both inherit from the
    >Template Control Class I have yet to read one word of official documentation
    >that explicitly states the MasterPage --is a-- User Control. Furthermore,
    >there is so much documentation stating otherwise not to mention how
    >different each is in usage that I have been surprised people continue to
    >insist on claiming --is a-- rather then the more correct --type of--
    >description.


    http://msdn.microsoft.com/en-us/library/system.web.ui.masterpage.aspx

    which has:

    [AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level =
    AspNetHostingPermissionLevel.Minimal)]
    [AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand,
    Level = AspNetHostingPermissionLevel.Minimal)]
    public class MasterPage : UserControl

    --
    http://www.sgat-computing-services.co.uk/
     
    Gareth Erskine-Jones, Dec 7, 2008
    #17
  18. pvong

    Hillbilly Guest

    Okay, I asked about drafting knowledge as it provides a perfect explanation
    for how to understand MasterPages which was conceptually copied from overlay
    drafting techniques and procedures used to build documents from templates.

    Sure, you can use iFrames if you want as it is an easy way out but they can
    and will impose gotchas here and there; unintended consequences. Try to work
    with this code [1] as it is a better approach in the long run. The code will
    strip out the parts of the HTML file that cannot be reused in a Content Page
    which is why I asked other questions.

    [1] http://www.mikesdotnetting.com/Article.aspx?ArticleID=33

    "pvong" <phillip*at*yahoo*dot*com> wrote in message
    news:...
    >
    > "Hillbilly" <> wrote in message
    > news:...
    >> Basically right but I need some preliminary information. For example
    >> answer the following yes or no questions...
    >>
    >> Q. Do you have any control of the .htm file at all?

    > NO
    >>
    >> Q. Is it possible to have the 3rd party software program save the file
    >> without the following tags sets: <html>, <head>, <title>, and <body>?

    > NO
    >>
    >> Q. Is it possible to have the file saved to a different file extenstion:
    >> .inc or .asp?

    > NO
    >>
    >> Q. Do you know what an HTML include directive is?

    > NO
    >>
    >> Q. Do you know what an ASP.NET User Control is yet?

    > YES
    >>
    >> Q. Did you ever do any mechanical or architectural drafting in school,
    >> for a hobby or for employment?

    > NO. I was an accounting major and I'm currently the CFO and help run a
    > $100mn mutual fund company. Programming is my hobby and not my profession
    > and it can never be. Just because it can never be my profession does not
    > mean I don't want to learn more about my hobby.
    >
    > SO - Am I right to think I need to stick with iFrame since I have no
    > control of the output from this other software? It's always going to
    > generate an htm file. I know I can probably write some kind of program
    > that will break the file down, but it may not be worth it since it's
    > repeated everynight and the htm is fine the way it is. It's just not
    > built for Mastpage scenerio.
    >>
    >>
    >>
    >>
    >> "pvong" <phillip*at*yahoo*dot*com> wrote in message
    >> news:...
    >>> Hillbilly - I'm willing to take a stab at this if you're willing to
    >>> help. Please note I'm still a newbie at this. I'm doing all this in
    >>> vb.net.
    >>>
    >>> - The reason why I'm thinking I had to use iFrames is:
    >>> Every night, a 3rd party software generates a plain old .htm file. So
    >>> this file deletes and creates a new .htm file every night. From reading
    >>> the discussion you guys had, I've come to the conclusion that a Content
    >>> Page is actually the main page and the Master Page is just like a
    >>> wrapper that wraps around the Content page. I know I'm not talking in
    >>> official programmers languauge, but I'm a newbie so I have to talk about
    >>> it in simple form so I can understand. So, if a 3rd party program is
    >>> creating this htm file every night, it does not know that it's going to
    >>> be a part of the MasterPage so it can never be a Content Page, right?
    >>> Then I'm stuck with iFrame, right?
    >>>
    >>> -If I'm wrong, how can a simple plain htm from a 3rd party software load
    >>> in a Content Page?
    >>>
    >>> Thanks!
    >>> Phil
    >>>
    >>>

    >>

    >
    >
     
    Hillbilly, Dec 8, 2008
    #18
  19. pvong

    Hillbilly Guest

    This article [1] is helpful for us if as you suggest we attempt to classify
    dogs and human beings using OOP as a means to manifest the classification.
    Try to explain to me how we cab subclass dogs and human beings as we are
    from different species ;-)

    But I've now come to terms with the fact that MasterPage is a UserControl.


    [1] http://en.wikipedia.org/wiki/Species



    news:...
    > On Sat, 29 Nov 2008 10:53:54 -0600, "Hillbilly"
    > <> wrote:
    >
    >>Hello Christophe.
    >>Is a dog also a human being because we both have legs or are we both a
    >>type
    >>of mammal?

    >
    > Don't confuse the regular use of a term (in this case "is a") with
    > it's technical uses in particular contexts.
    >
    > If dog, mammal and humanBeing are OO classes, then
    >
    > In OO terms, a dog "is a" mammal, and a humanBeing "is a" mammal.
    >
    > This is pretty standard terminology, i.e.:
    >
    > type A "is a" "type B" means "type A is the same as type B or type A
    > is a sub class of type B".
    >
    > MasterPage subclasses UserControl, and so a MasterPage "is a"
    > UserControl.
    >
    >
    >
    >>"Christophe Lephay" <> wrote in message
    >>news:...
    >>> "Mark Rae [MVP]" <> a écrit dans le message de
    >>> groupe de discussion : OFTg6$...
    >>>> "Hillbilly" <> wrote in message
    >>>> news:%...
    >>>>
    >>>>> The other stuff Rae discussed I tend to agree with except to note
    >>>>> MasterPage is not a user control but a type of user control as there
    >>>>> is
    >>>>> a difference between "is a" and "type of".
    >>>>
    >>>> Ignore the above - a MasterPage is a UserControl.
    >>>
    >>> A more detailed answer could be that OO design is based on the
    >>> assumption
    >>> that any (sub)Type of X is an X (see Liskov Substitution Principle).

    > --
    > http://www.sgat-computing-services.co.uk/
     
    Hillbilly, Dec 8, 2008
    #19
    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. =?Utf-8?B?QWxleCBNYWdoZW4=?=

    MasterPage -> Page -> MasterPage Code Access

    =?Utf-8?B?QWxleCBNYWdoZW4=?=, Apr 10, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    7,908
    Steven Cheng[MSFT]
    Apr 14, 2006
  2. Barkster
    Replies:
    5
    Views:
    424
    Barkster
    Oct 30, 2006
  3. Shailesh Patel
    Replies:
    2
    Views:
    817
    Steve C. Orr [MVP, MCSD]
    Nov 15, 2006
  4. Torben Laursen
    Replies:
    4
    Views:
    578
    clintonG
    Mar 15, 2008
  5. Sinan Alkan
    Replies:
    1
    Views:
    1,428
    Nathan Sokalski
    Sep 17, 2008
Loading...

Share This Page