Dynamically generated page

Discussion in 'ASP .Net' started by Matjaz Zalar, Nov 25, 2003.

  1. Matjaz Zalar

    Matjaz Zalar Guest

    Hi,
    I have following problem:
    1. template content is stored in database string field, for example:

    "<HTML><HEAD></HEAD><BODY ID="BODYTAG"></BODY></HTML>

    2. page content is also stored in database:

    "<div>Hello Problem!!</div>"

    3. page.aspx must first load template value and then inserts into template
    body innerHTML value of content.

    Question:

    Is there any possibility to access body through ID:

    BODYTAG.innerHTML = "<div>Hello Problem!!</div>"

    Thanks for Your reply,


    Matjaz Zalar
    Matjaz Zalar, Nov 25, 2003
    #1
    1. Advertising

  2. Matjaz,

    Yes you can access the body tag from code-behind.

    I have sample code on my website: www.aboutfortunate.com. Just go to the
    code library and then use the search text box there. Enter "Use body tag as
    server control" or something similar and you'll find the sample code.

    Any questions? Feel free to email me (Anyone).

    --
    Sincerely,

    S. Justin Gengo, MCP
    Web Developer / Programmer

    Free code library at:
    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzche


    "Matjaz Zalar" <> wrote in message
    news:%...
    > Hi,
    > I have following problem:
    > 1. template content is stored in database string field, for example:
    >
    > "<HTML><HEAD></HEAD><BODY ID="BODYTAG"></BODY></HTML>
    >
    > 2. page content is also stored in database:
    >
    > "<div>Hello Problem!!</div>"
    >
    > 3. page.aspx must first load template value and then inserts into template
    > body innerHTML value of content.
    >
    > Question:
    >
    > Is there any possibility to access body through ID:
    >
    > BODYTAG.innerHTML = "<div>Hello Problem!!</div>"
    >
    > Thanks for Your reply,
    >
    >
    > Matjaz Zalar
    >
    >
    S. Justin Gengo, Nov 25, 2003
    #2
    1. Advertising

  3. Matjaz Zalar

    Matjaz Zalar Guest

    Thanks,
    but your example simply add new generic HTML control. I have already specify
    BODY tag in template, so your approach would give me another BODY
    tag-control which has no relation to template BODY tag.

    "S. Justin Gengo" <> wrote in message
    news:...
    > Matjaz,
    >
    > Yes you can access the body tag from code-behind.
    >
    > I have sample code on my website: www.aboutfortunate.com. Just go to the
    > code library and then use the search text box there. Enter "Use body tag

    as
    > server control" or something similar and you'll find the sample code.
    >
    > Any questions? Feel free to email me (Anyone).
    >
    > --
    > Sincerely,
    >
    > S. Justin Gengo, MCP
    > Web Developer / Programmer
    >
    > Free code library at:
    > www.aboutfortunate.com
    >
    > "Out of chaos comes order."
    > Nietzche
    >
    >
    > "Matjaz Zalar" <> wrote in message
    > news:%...
    > > Hi,
    > > I have following problem:
    > > 1. template content is stored in database string field, for example:
    > >
    > > "<HTML><HEAD></HEAD><BODY ID="BODYTAG"></BODY></HTML>
    > >
    > > 2. page content is also stored in database:
    > >
    > > "<div>Hello Problem!!</div>"
    > >
    > > 3. page.aspx must first load template value and then inserts into

    template
    > > body innerHTML value of content.
    > >
    > > Question:
    > >
    > > Is there any possibility to access body through ID:
    > >
    > > BODYTAG.innerHTML = "<div>Hello Problem!!</div>"
    > >
    > > Thanks for Your reply,
    > >
    > >
    > > Matjaz Zalar
    > >
    > >

    >
    >
    Matjaz Zalar, Nov 25, 2003
    #3
  4. Matajaz,

    You didn't look closely enough. The code doesn't add a second body control
    tag. It converts the original into a server side control that can be
    manipulated.

    --
    Sincerely,

    S. Justin Gengo, MCP
    Web Developer / Programmer

    Free code library at:
    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzche


    "Matjaz Zalar" <> wrote in message
    news:...
    > Thanks,
    > but your example simply add new generic HTML control. I have already

    specify
    > BODY tag in template, so your approach would give me another BODY
    > tag-control which has no relation to template BODY tag.
    >
    > "S. Justin Gengo" <> wrote in message
    > news:...
    > > Matjaz,
    > >
    > > Yes you can access the body tag from code-behind.
    > >
    > > I have sample code on my website: www.aboutfortunate.com. Just go to the
    > > code library and then use the search text box there. Enter "Use body tag

    > as
    > > server control" or something similar and you'll find the sample code.
    > >
    > > Any questions? Feel free to email me (Anyone).
    > >
    > > --
    > > Sincerely,
    > >
    > > S. Justin Gengo, MCP
    > > Web Developer / Programmer
    > >
    > > Free code library at:
    > > www.aboutfortunate.com
    > >
    > > "Out of chaos comes order."
    > > Nietzche
    > >
    > >
    > > "Matjaz Zalar" <> wrote in message
    > > news:%...
    > > > Hi,
    > > > I have following problem:
    > > > 1. template content is stored in database string field, for example:
    > > >
    > > > "<HTML><HEAD></HEAD><BODY ID="BODYTAG"></BODY></HTML>
    > > >
    > > > 2. page content is also stored in database:
    > > >
    > > > "<div>Hello Problem!!</div>"
    > > >
    > > > 3. page.aspx must first load template value and then inserts into

    > template
    > > > body innerHTML value of content.
    > > >
    > > > Question:
    > > >
    > > > Is there any possibility to access body through ID:
    > > >
    > > > BODYTAG.innerHTML = "<div>Hello Problem!!</div>"
    > > >
    > > > Thanks for Your reply,
    > > >
    > > >
    > > > Matjaz Zalar
    > > >
    > > >

    > >
    > >

    >
    >
    S. Justin Gengo, Nov 25, 2003
    #4
  5. Matjaz Zalar

    Matjaz Zalar Guest

    In Your example there is <body> tag in html part of webform. Mine page.aspx
    have NO BODY TAG or any one eather! The HTML part is loaded from database
    value first for template and then for content.

    Matjaz



    "S. Justin Gengo" <> wrote in message
    news:...
    > Matajaz,
    >
    > You didn't look closely enough. The code doesn't add a second body control
    > tag. It converts the original into a server side control that can be
    > manipulated.
    >
    > --
    > Sincerely,
    >
    > S. Justin Gengo, MCP
    > Web Developer / Programmer
    >
    > Free code library at:
    > www.aboutfortunate.com
    >
    > "Out of chaos comes order."
    > Nietzche
    >
    >
    > "Matjaz Zalar" <> wrote in message
    > news:...
    > > Thanks,
    > > but your example simply add new generic HTML control. I have already

    > specify
    > > BODY tag in template, so your approach would give me another BODY
    > > tag-control which has no relation to template BODY tag.
    > >
    > > "S. Justin Gengo" <> wrote in message
    > > news:...
    > > > Matjaz,
    > > >
    > > > Yes you can access the body tag from code-behind.
    > > >
    > > > I have sample code on my website: www.aboutfortunate.com. Just go to

    the
    > > > code library and then use the search text box there. Enter "Use body

    tag
    > > as
    > > > server control" or something similar and you'll find the sample code.
    > > >
    > > > Any questions? Feel free to email me (Anyone).
    > > >
    > > > --
    > > > Sincerely,
    > > >
    > > > S. Justin Gengo, MCP
    > > > Web Developer / Programmer
    > > >
    > > > Free code library at:
    > > > www.aboutfortunate.com
    > > >
    > > > "Out of chaos comes order."
    > > > Nietzche
    > > >
    > > >
    > > > "Matjaz Zalar" <> wrote in message
    > > > news:%...
    > > > > Hi,
    > > > > I have following problem:
    > > > > 1. template content is stored in database string field, for example:
    > > > >
    > > > > "<HTML><HEAD></HEAD><BODY ID="BODYTAG"></BODY></HTML>
    > > > >
    > > > > 2. page content is also stored in database:
    > > > >
    > > > > "<div>Hello Problem!!</div>"
    > > > >
    > > > > 3. page.aspx must first load template value and then inserts into

    > > template
    > > > > body innerHTML value of content.
    > > > >
    > > > > Question:
    > > > >
    > > > > Is there any possibility to access body through ID:
    > > > >
    > > > > BODYTAG.innerHTML = "<div>Hello Problem!!</div>"
    > > > >
    > > > > Thanks for Your reply,
    > > > >
    > > > >
    > > > > Matjaz Zalar
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Matjaz Zalar, Nov 26, 2003
    #5
  6. Matjaz,

    That's my point. Change your template so that it doesn't add the body tag.
    Use a dynamic body tag on the page your template is loading into so that you
    can control what you need to.

    --
    Sincerely,

    S. Justin Gengo, MCP
    Web Developer / Programmer

    Free code library at:
    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzche


    "Matjaz Zalar" <> wrote in message
    news:eAs%23St%...
    > In Your example there is <body> tag in html part of webform. Mine

    page.aspx
    > have NO BODY TAG or any one eather! The HTML part is loaded from database
    > value first for template and then for content.
    >
    > Matjaz
    >
    >
    >
    > "S. Justin Gengo" <> wrote in message
    > news:...
    > > Matajaz,
    > >
    > > You didn't look closely enough. The code doesn't add a second body

    control
    > > tag. It converts the original into a server side control that can be
    > > manipulated.
    > >
    > > --
    > > Sincerely,
    > >
    > > S. Justin Gengo, MCP
    > > Web Developer / Programmer
    > >
    > > Free code library at:
    > > www.aboutfortunate.com
    > >
    > > "Out of chaos comes order."
    > > Nietzche
    > >
    > >
    > > "Matjaz Zalar" <> wrote in message
    > > news:...
    > > > Thanks,
    > > > but your example simply add new generic HTML control. I have already

    > > specify
    > > > BODY tag in template, so your approach would give me another BODY
    > > > tag-control which has no relation to template BODY tag.
    > > >
    > > > "S. Justin Gengo" <> wrote in message
    > > > news:...
    > > > > Matjaz,
    > > > >
    > > > > Yes you can access the body tag from code-behind.
    > > > >
    > > > > I have sample code on my website: www.aboutfortunate.com. Just go to

    > the
    > > > > code library and then use the search text box there. Enter "Use body

    > tag
    > > > as
    > > > > server control" or something similar and you'll find the sample

    code.
    > > > >
    > > > > Any questions? Feel free to email me (Anyone).
    > > > >
    > > > > --
    > > > > Sincerely,
    > > > >
    > > > > S. Justin Gengo, MCP
    > > > > Web Developer / Programmer
    > > > >
    > > > > Free code library at:
    > > > > www.aboutfortunate.com
    > > > >
    > > > > "Out of chaos comes order."
    > > > > Nietzche
    > > > >
    > > > >
    > > > > "Matjaz Zalar" <> wrote in message
    > > > > news:%...
    > > > > > Hi,
    > > > > > I have following problem:
    > > > > > 1. template content is stored in database string field, for

    example:
    > > > > >
    > > > > > "<HTML><HEAD></HEAD><BODY ID="BODYTAG"></BODY></HTML>
    > > > > >
    > > > > > 2. page content is also stored in database:
    > > > > >
    > > > > > "<div>Hello Problem!!</div>"
    > > > > >
    > > > > > 3. page.aspx must first load template value and then inserts into
    > > > template
    > > > > > body innerHTML value of content.
    > > > > >
    > > > > > Question:
    > > > > >
    > > > > > Is there any possibility to access body through ID:
    > > > > >
    > > > > > BODYTAG.innerHTML = "<div>Hello Problem!!</div>"
    > > > > >
    > > > > > Thanks for Your reply,
    > > > > >
    > > > > >
    > > > > > Matjaz Zalar
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    S. Justin Gengo, Dec 1, 2003
    #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. Chris Jones
    Replies:
    0
    Views:
    1,273
    Chris Jones
    Jun 25, 2003
  2. Chris Jones

    Dynamically generated png images

    Chris Jones, Jun 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    517
    Kevin Spencer
    Jun 27, 2003
  3. Rick Spiewak
    Replies:
    5
    Views:
    790
    Lewis Wang [MSFT]
    Aug 1, 2003
  4. Gary Coutts

    Emailing a dynamically generated aspx page

    Gary Coutts, Apr 20, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    1,033
    Gary Coutts
    Apr 23, 2006
  5. Sisilla
    Replies:
    16
    Views:
    186
    Sisilla
    Sep 25, 2007
Loading...

Share This Page