How to generate and compile aspx pages dynamically

How Can I to generate and compile aspx pages dynamically.
Suppose I have a application testApp.
On one of its page I have a button GeneratePage and a TextBox For the Page Name.
and a checkbox for iscodebehind .
and a combobox for languages.
When I provide the desired information and then click generate button a new page will be generated and compiled

into the application.
(currently it doesn't matter what the content will be for this page)

I am looking for the solution in C#

[509 byte] By [Kamii47] at [2008-2-7]
# 1

lol ... building your own asp.net development tool?

i think just generating the aspx, cs file and uploading them to server will do the job.

Nightmare_BE at 2007-9-10 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...
# 2
Mister NightMare If You Don't have a solution then Please don't comment.
Kamii47 at 2007-9-10 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...
# 3
You might be better off asking this question in the ASP.NET forum, even though your question involves C#. The people that know most about ASP will be in the ASP forum.
MatthewWatson at 2007-9-10 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...
# 4
Thanks I have already posted the same question there.
Kamii47 at 2007-9-10 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...
# 5

Kamii47 wrote:
Mister NightMare If You Don't have a solution then Please don't comment.

Sorry ... but did u try what i typed? just put the aspx and cs file on a webserver?

I dont think asp.net 2005 are compiled into dll files no more. so just give it a try

Nightmare_BE at 2007-9-10 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...
# 6
Nightmare is right, in 2.0 asp.net will parse and compile both the .aspx and it's code-beside .cs file on first request.
ScottAllen at 2007-9-10 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...
# 7

Thanks Nightmare I already know that we are not needed to recompile the application when we upload new file.As according to the new architecture when we run the application each page is compile into a single temprory dll then so on..

But What I like is to what function of .net are called when we create a add new item dialog box.

I know it uses C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates\Web\CSharp\1033\WebForm.zip

Template in which there is a file WebForm.vstemplate which does all this thing of creating a webform.

But This hole process (that is which class is called which funtions are called e.t.c) is done I want's to find out that.

I know it is a little tuff thing but I thought some one could give me a clue.

Kamii47 at 2007-9-10 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...
# 8

u mean the functions used by the visual studio ide?

i dont think u need that if u want to generate your own pages and code files.

U can use the templates provided with visual studio (check the vs license to see if u are allowed to do that) or make your own.

i guess only thing vs does when creating a new page is getting the template and replace some strings in it (like pagename and stuff)

Nightmare_BE at 2007-9-10 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...
# 9

Thanks Nightmare.I have done that.It has solve my problem a little so that i have made my sample templated pages and user controls.

But as in custom code snippet we make some xml file with our required text and then in the code behind or other class files we simly add those text.I want to get same functionality for design or html view of the page.That is I want's made a xmlfile (like code snippet)for particular grid or particular type of table e.t.c then insert those in the same way as code snippet on the html view.

Could in any way I could do that ?

Kamii47 at 2007-9-10 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...
# 10

i dont realy understand what u mean with this ...

Nightmare_BE at 2007-9-10 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...