writing a simple code generator

Discussion in 'ASP .Net' started by John Mott, Feb 21, 2006.

  1. John Mott

    John Mott Guest

    I've played with some code generators; they all have what appears to be aspx
    web pages run from a desktop program. The pages have a code section and a
    section where they use <% %> operators to instantiate content.

    I have a very specific and surgical need and want to do this from a desktop
    program. Is it as simple as instantiating an object thats derived from
    system.web.ui.page and invoking a 'execute this' method of some sort and get
    a string back? Or am I dreaming ;-)

    john mott
    John Mott, Feb 21, 2006
    #1
    1. Advertising

  2. John Mott

    Scott Allen Guest

    The selection of the <% %> delimiters is arbitrary. CodeSmith uses
    those characters, and GenX from Developmentor did, too. I'm just
    speculating, but both products probably picked those characters
    because MS developers are familar with using <% %> to provide
    'instructions to execute' inside some form of declarative markup.

    A Page class won't be able to interpret the special syntax for a code
    generator.

    Hope that makes sense,

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    On Tue, 21 Feb 2006 11:15:28 -0600, "John Mott"
    <> wrote:

    >I've played with some code generators; they all have what appears to be aspx
    >web pages run from a desktop program. The pages have a code section and a
    >section where they use <% %> operators to instantiate content.
    >
    >I have a very specific and surgical need and want to do this from a desktop
    >program. Is it as simple as instantiating an object thats derived from
    >system.web.ui.page and invoking a 'execute this' method of some sort and get
    >a string back? Or am I dreaming ;-)
    >
    >john mott
    >
    Scott Allen, Feb 21, 2006
    #2
    1. Advertising

  3. John Mott

    John Mott Guest

    Thanks Scott,

    What about the big picture? Whats behind the ability to launch a file with
    code and constructs that are embedded in it and have it compile the code and
    run the page?

    thanks,

    john


    "Scott Allen" <> wrote in message
    news:...
    > The selection of the <% %> delimiters is arbitrary. CodeSmith uses
    > those characters, and GenX from Developmentor did, too. I'm just
    > speculating, but both products probably picked those characters
    > because MS developers are familar with using <% %> to provide
    > 'instructions to execute' inside some form of declarative markup.
    >
    > A Page class won't be able to interpret the special syntax for a code
    > generator.
    >
    > Hope that makes sense,
    >
    > --
    > Scott
    > http://www.OdeToCode.com/blogs/scott/
    >
    > On Tue, 21 Feb 2006 11:15:28 -0600, "John Mott"
    > <> wrote:
    >
    >>I've played with some code generators; they all have what appears to be
    >>aspx
    >>web pages run from a desktop program. The pages have a code section and a
    >>section where they use <% %> operators to instantiate content.
    >>
    >>I have a very specific and surgical need and want to do this from a
    >>desktop
    >>program. Is it as simple as instantiating an object thats derived from
    >>system.web.ui.page and invoking a 'execute this' method of some sort and
    >>get
    >>a string back? Or am I dreaming ;-)
    >>
    >>john mott
    >>

    >
    John Mott, Feb 21, 2006
    #3
    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. Martin Maurer
    Replies:
    3
    Views:
    4,783
    Peter
    Apr 19, 2006
  2. TheDustbustr
    Replies:
    1
    Views:
    436
    Sami Hangaslammi
    Jul 25, 2003
  3. Replies:
    9
    Views:
    529
  4. Chris Withers

    Problems with email.Generator.Generator

    Chris Withers, Sep 11, 2006, in forum: Python
    Replies:
    20
    Views:
    1,671
    Max M
    Sep 12, 2006
  5. Terry Reedy

    Generator functions subclass generator?

    Terry Reedy, Jun 18, 2009, in forum: Python
    Replies:
    0
    Views:
    449
    Terry Reedy
    Jun 18, 2009
Loading...

Share This Page