Ask a Question related to ASP.NET Building Controls, Design and Development.
-
bestwerx@gmail.com #1
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
-
Contribute and Server Side Code
Hi, I have been experimenting with, and reading about Contribute as much as I can the past couple of weeks. Unfortunately there isn't much in the... -
JavaScript and server side code
s there any way to use JavaScipt to send variables recovered to servers side code or a database? Thanks. -
How To: handle DataGrid row Click Event that passes rows column values to server-side code behind function
I've looked through many posted messages, and have tried several things but have not seemed to solve this (what you'd think would be a simple)... -
Intellisense Code Behind vs. Server Side Script Block
Because it was not implemented. Intellisense is only supported C#, VB files not in ASPX files. George. "Mark" <mark.acuff@hp.com> wrote in... -
Editing server side code in docs based on template...
I've created several templates and then created quite a few documents based on those templates. Now when it comes to DW adding server side code, is... -
Gaurav Vaish \(www.EduJini.IN\) #2
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@gmail.com> wrote in message
news:1156247347.033783.287310@b28g2000cwb.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
-
Scott #3
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@gmail.com> wrote in message
> news:1156247347.033783.287310@b28g2000cwb.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
-
dave.dolan #4
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@gmail.com> wrote in message
> > news:1156247347.033783.287310@b28g2000cwb.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
-
MRe #5
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@gmail.com> wrote in message
news:1156275376.250257.180810@i42g2000cwa.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@gmail.com> wrote in message
| > news:1156247347.033783.287310@b28g2000cwb.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



Reply With Quote

