HighTechTalks DotNet Forums  

Generate ASPX file at runtime.

Dotnet VSA microsoft.public.dotnet.vsa


Discuss Generate ASPX file at runtime. in the Dotnet VSA forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Generate ASPX file at runtime. - 06-03-2004 , 04:28 PM






Hi!

I must generate webform and his controls at runtime(ASPX and Code
behind). I am able to create the codebehind file with CodeDom but
can't create the aspx file.

How can I create at runtime aspx file and synchronize it with the
codebehind file.

Thanks

Jeff

Reply With Quote
  #2  
Old   
bruce barker
 
Posts: n/a

Default Re: Generate ASPX file at runtime. - 06-03-2004 , 04:43 PM






your approach may not quite work, when asp.net first hits an aspx page, it
parses it and builds a dll in a temp dir and loads it (much like you are
doing with the codedom). if when you build the codebehind, you build a dll
for it, the dynamic aspx page could compile against it. if you regen the
same webforms, the appdomain is dumped, and the pages are recompiled.


-- bruce (sqlwork.com)




"jf_cote" <jf_cote (AT) msn (DOT) com> wrote

Quote:
Hi!

I must generate webform and his controls at runtime(ASPX and Code
behind). I am able to create the codebehind file with CodeDom but
can't create the aspx file.

How can I create at runtime aspx file and synchronize it with the
codebehind file.

Thanks

Jeff



Reply With Quote
  #3  
Old   
AT
 
Posts: n/a

Default Re: Generate ASPX file at runtime. - 06-04-2004 , 09:17 AM



Sorry I miss explain clearly the runtime context I was talking about.
The .aspx file must be creating by an addin to VS.NET 2003 and not
during WEBApplication execution. The .aspx and codebehind file will be
creating during design time in VS.Net. The addin will be embedded in
VS.Net 2003 and will be executing by the ‘File‘ | ‘New Project'…|
‘Project Types: Visual C# Project' menu item.

The addin will made that work:
- Create an empty WEB project base on Microsoft templates.
- Add programmatically references to my custom assembly in the
project.
- Allow the user to add custom WEBForm (Right-click on the project
node in the Solution Explorer).

So when the user will add a custom WEBForm I must create the
codebehind file and the .aspx file(with WEBControls) and synchronize
it. How can I do that? With the CodeDOM class I can create the
codebehind file but I don't know how to create .aspx part of the
WEBForm.

Thanks.

Jeff


"bruce barker" <nospam_brubar (AT) safeco (DOT) com> wrote

Quote:
your approach may not quite work, when asp.net first hits an aspx page, it
parses it and builds a dll in a temp dir and loads it (much like you are
doing with the codedom). if when you build the codebehind, you build a dll
for it, the dynamic aspx page could compile against it. if you regen the
same webforms, the appdomain is dumped, and the pages are recompiled.


-- bruce (sqlwork.com)




"jf_cote" <jf_cote (AT) msn (DOT) com> wrote in message
news:b7af86db.0406031228.40841353 (AT) posting (DOT) google.com...
Hi!

I must generate webform and his controls at runtime(ASPX and Code
behind). I am able to create the codebehind file with CodeDom but
can't create the aspx file.

How can I create at runtime aspx file and synchronize it with the
codebehind file.

Thanks

Jeff

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.