Inline Expression Resolution

Discussion in 'ASP .Net Web Controls' started by Darin, Jun 19, 2005.

  1. Darin

    Darin Guest

    Hi everyone:

    I have a particular situation where I'd like to serve up the content of
    essentially static html coming out of a database for a website.

    I've created a generic user control to actually handle retrieving the
    html text and I've overridden the RENDER method to render the html at
    the point the control is rendered (the static text actually sits inside
    a master template page and the static control is dynamically created on
    the master page)

    All this works fine as it is.

    However, I'd like to be able to use small inline expressions (of the
    form
    <%= FunctionName() %> at various places in the otherwise static html and
    have those expressions evaluated when the page is rendered, just like a
    normal ASPX or ASCX page. But that doesn't seem to work, when you write
    the text as output through the HTMLTextWriter you get through the RENDER
    method

    I assume I'm not inserting the html early enough in the rendering
    pipeline.

    Would anyone have any ideas how to go about doing this (or maybe there's
    a better way to accomplish the same thing that I'm not familiar with?

    Thanks
    Darin
     
    Darin, Jun 19, 2005
    #1
    1. Advertising

  2. Darin

    Harolds Guest

    Instead of using Render, place the html into the text property of a literal,
    then your html will display, and your code will execute when the page is
    rendered.

    "Darin" wrote:

    > Hi everyone:
    >
    > I have a particular situation where I'd like to serve up the content of
    > essentially static html coming out of a database for a website.
    >
    > I've created a generic user control to actually handle retrieving the
    > html text and I've overridden the RENDER method to render the html at
    > the point the control is rendered (the static text actually sits inside
    > a master template page and the static control is dynamically created on
    > the master page)
    >
    > All this works fine as it is.
    >
    > However, I'd like to be able to use small inline expressions (of the
    > form
    > <%= FunctionName() %> at various places in the otherwise static html and
    > have those expressions evaluated when the page is rendered, just like a
    > normal ASPX or ASCX page. But that doesn't seem to work, when you write
    > the text as output through the HTMLTextWriter you get through the RENDER
    > method
    >
    > I assume I'm not inserting the html early enough in the rendering
    > pipeline.
    >
    > Would anyone have any ideas how to go about doing this (or maybe there's
    > a better way to accomplish the same thing that I'm not familiar with?
    >
    > Thanks
    > Darin
    >
    >
     
    Harolds, Jun 22, 2005
    #2
    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. Andrew FPGA
    Replies:
    0
    Views:
    985
    Andrew FPGA
    Sep 26, 2005
  2. Darin Higgins

    Inline Expression Resolution

    Darin Higgins, Jun 21, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    1,673
  3. Abhi
    Replies:
    2
    Views:
    751
    E. Robert Tisdale
    Jul 3, 2003
  4. Alvin
    Replies:
    7
    Views:
    489
    E. Robert Tisdale
    May 6, 2005
  5. Replies:
    3
    Views:
    473
Loading...

Share This Page