Professional Web Applications Themes

How do I add server -side code at runtime? - ASP.NET Building Controls

I am building an application that is totally data driven. The pages are built from scratch at runtime.I have everything working fine. Now all I need to do is to have the ability to add code both server-side and client-sie at runtime. I think I have pretttty much figured out the client side part. My problem is the servre-side code. How do i inject and/or run server-side code (frfom the database) at runtime?...

  1. #1

    Default How do I add server -side code at runtime?

    I am building an application that is totally data driven. The pages are
    built from scratch at runtime.I have everything working fine. Now all I
    need to do is to have the ability to add code both server-side and
    client-sie at runtime. I think I have pretttty much figured out the
    client side part. My problem is the servre-side code. How do i inject
    and/or run server-side code (frfom the database) at runtime?

    bestwerx@gmail.com Guest

  2. #2

    Default Re: How do I add server -side code at runtime?

    Are you generating C#/VB.Net code on the fly?
    Yikes! Well... you would be needing
    System.CodeDom.Compiler.CSharpCodeProvider or
    System.CodeDom.Compiler.VBCodeProvider

    for the code to be compiled on the fly.

    But I am damn sure... there are better things around. May be you can share
    some more information about your website / application!


    --
    Happy Hacking,
    Gaurav Vaish | [url]http://www.mastergaurav.org[/url]
    [url]http://www.edujini.in[/url] | [url]http://webservices.edujini.in[/url]
    -------------------


    <bestwerx> wrote in message
    news:1156247347.033783.287310b28g2000cwb.googlegr oups.com...
    >I am building an application that is totally data driven. The pages are
    > built from scratch at runtime.I have everything working fine. Now all I
    > need to do is to have the ability to add code both server-side and
    > client-sie at runtime. I think I have pretttty much figured out the
    > client side part. My problem is the servre-side code. How do i inject
    > and/or run server-side code (frfom the database) at runtime?
    >

    Gaurav Vaish \(www.EduJini.IN\) Guest

  3. #3

    Default Re: How do I add server -side code at runtime?

    Thx
    I will try this
    And yes, I am generating code on the fly
    sw

    Gaurav Vaish ([url]www.EduJini.IN[/url]) wrote:
    > Are you generating C#/VB.Net code on the fly?
    > Yikes! Well... you would be needing
    > System.CodeDom.Compiler.CSharpCodeProvider or
    > System.CodeDom.Compiler.VBCodeProvider
    >
    > for the code to be compiled on the fly.
    >
    > But I am damn sure... there are better things around. May be you can share
    > some more information about your website / application!
    >
    >
    > --
    > Happy Hacking,
    > Gaurav Vaish | [url]http://www.mastergaurav.org[/url]
    > [url]http://www.edujini.in[/url] | [url]http://webservices.edujini.in[/url]
    > -------------------
    >
    >
    > <bestwerx> wrote in message
    > news:1156247347.033783.287310b28g2000cwb.googlegr oups.com...
    > >I am building an application that is totally data driven. The pages are
    > > built from scratch at runtime.I have everything working fine. Now all I
    > > need to do is to have the ability to add code both server-side and
    > > client-sie at runtime. I think I have pretttty much figured out the
    > > client side part. My problem is the servre-side code. How do i inject
    > > and/or run server-side code (frfom the database) at runtime?
    > >
    Scott Guest

  4. #4

    Default Re: How do I add server -side code at runtime?

    Don't forget about DynamicMethod. You can create a delegate to an arbitrary
    method, constructor, or property accessor anywhere... and it works lots
    faster than the Invoke on MethodInfo via reflection. (You can cache
    delegates in a dictionary, for example, and have the ability to access
    properties or methods by a string name)

    There is an introduction to this type of thing on a CodeProject article:
    [url]http://www.codeproject.com/csharp/DynamicMethodDelegates.asp?print=true[/url]

    There's also something on MSDN about it, but it's not very helpful.

    If you want to get really fancy and use generics that determine their type
    parameters at runtime, then you'll have to do something like this :
    [url]http://musingmarc.blogspot.com/2006/08/how-to-do-late-dynamic-method-creation.html[/url] (Marc is one of my newfound hero's)


    "Scott" wrote:
    > Thx
    > I will try this
    > And yes, I am generating code on the fly
    > sw
    >
    > Gaurav Vaish ([url]www.EduJini.IN[/url]) wrote:
    > > Are you generating C#/VB.Net code on the fly?
    > > Yikes! Well... you would be needing
    > > System.CodeDom.Compiler.CSharpCodeProvider or
    > > System.CodeDom.Compiler.VBCodeProvider
    > >
    > > for the code to be compiled on the fly.
    > >
    > > But I am damn sure... there are better things around. May be you can share
    > > some more information about your website / application!
    > >
    > >
    > > --
    > > Happy Hacking,
    > > Gaurav Vaish | [url]http://www.mastergaurav.org[/url]
    > > [url]http://www.edujini.in[/url] | [url]http://webservices.edujini.in[/url]
    > > -------------------
    > >
    > >
    > > <bestwerx> wrote in message
    > > news:1156247347.033783.287310b28g2000cwb.googlegr oups.com...
    > > >I am building an application that is totally data driven. The pages are
    > > > built from scratch at runtime.I have everything working fine. Now all I
    > > > need to do is to have the ability to add code both server-side and
    > > > client-sie at runtime. I think I have pretttty much figured out the
    > > > client side part. My problem is the servre-side code. How do i inject
    > > > and/or run server-side code (frfom the database) at runtime?
    > > >
    >
    >
    dave.dolan Guest

  5. #5

    Default Re: How do I add server -side code at runtime?

    I found [url]http://www.west-wind.com/presentations/dynamicCode/DynamicCode.htm[/url]
    to be a pretty good reference on doing this.. put me right off the idea :)
    You could also use the Script control (though you'll have to use vbscript or
    javascript) - Add a reference to the COM \ Microsoft Script Control 1.0 and
    do like..

    <snip>
    ScriptControl script = new ScriptControl();
    script.Language = "vbscript";
    script.AddObject("joe", new ken(), true);
    Response.Write(script.Eval("(1 + 3) * joe.bob"));
    </snip>

    [ComVisible(true)]
    public partial class ken
    {
    public int bob = 3;
    }

    ...too easy!

    Regards,
    Eliott


    "Scott" <bestwerx> wrote in message
    news:1156275376.250257.180810i42g2000cwa.googlegr oups.com...
    | Thx
    | I will try this
    | And yes, I am generating code on the fly
    | sw
    |
    | Gaurav Vaish ([url]www.EduJini.IN[/url]) wrote:
    | > Are you generating C#/VB.Net code on the fly?
    | > Yikes! Well... you would be needing
    | > System.CodeDom.Compiler.CSharpCodeProvider or
    | > System.CodeDom.Compiler.VBCodeProvider
    | >
    | > for the code to be compiled on the fly.
    | >
    | > But I am damn sure... there are better things around. May be you can
    share
    | > some more information about your website / application!
    | >
    | >
    | > --
    | > Happy Hacking,
    | > Gaurav Vaish | [url]http://www.mastergaurav.org[/url]
    | > [url]http://www.edujini.in[/url] | [url]http://webservices.edujini.in[/url]
    | > -------------------
    | >
    | >
    | > <bestwerx> wrote in message
    | > news:1156247347.033783.287310b28g2000cwb.googlegr oups.com...
    | > >I am building an application that is totally data driven. The pages are
    | > > built from scratch at runtime.I have everything working fine. Now all
    I
    | > > need to do is to have the ability to add code both server-side and
    | > > client-sie at runtime. I think I have pretttty much figured out the
    | > > client side part. My problem is the servre-side code. How do i inject
    | > > and/or run server-side code (frfom the database) at runtime?
    | > >
    |


    MRe Guest

Similar Threads

  1. Contribute and Server Side Code
    By Rob_Aus in forum Macromedia Contribute General Discussion
    Replies: 0
    Last Post: August 11th, 09:57 AM
  2. JavaScript and server side code
    By comprug in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: January 14th, 01:26 PM
  3. Replies: 0
    Last Post: October 4th, 04:02 PM
  4. Intellisense Code Behind vs. Server Side Script Block
    By George Ter-Saakov in forum ASP.NET General
    Replies: 1
    Last Post: July 15th, 01:08 PM
  5. Editing server side code in docs based on template...
    By Tim L in forum Macromedia Dreamweaver
    Replies: 3
    Last Post: July 11th, 10:32 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139