Dynamically create ASPX form

R

rishi145

i want to build a small cms and wanted to know if it was possible to
generate a aspx page dynamically? if so how
basically i wan to be able to have a button create new page and name
it.

thanks for any help guys

R
 
J

Jeff S

Just build a string variable (perhaps via StringBuilder) that contains the
HTML of the new page, then write it to disk using a TextWriter (or any other
of many ways to write text to a file on disk); giving it whatever name you
want when you write the file.

But do you really want to do that? You would have to deal with linking to
the page and otherwise making it accessible on your site. It might be easier
to have a "mostly blank" page into which you inject content dynamically at
runtime. Doing this would let you incorporate the page (by name) into your
site's menuing system or other existing links to it, while having completely
dynamic content. In other words, you'd have fewer problems to solve going
this route rather than building a new aspx file on disk.

-HTH
 
G

Guest

Jeffs right but I want to add you would be "rebuilding the wheel". Use
response.redirect("page2.aspx") to bring up a new page.
 
Joined
Sep 26, 2007
Messages
2
Reaction score
0
Jeff'S wrote:
Just build a string variable (perhaps via StringBuilder) that contains the
HTML of the new page, then write it to disk using a TextWriter (or any other
of many ways to write text to a file on disk); giving it whatever name you
want when you write the file.

But do you really want to do that? You would have to deal with linking to
the page and otherwise making it accessible on your site. It might be easier
to have a "mostly blank" page into which you inject content dynamically at
runtime. Doing this would let you incorporate the page (by name) into your
site's menuing system or other existing links to it, while having completely
dynamic content. In other words, you'd have fewer problems to solve going
this route rather than building a new aspx file on disk.

-HTH


The way how to deal with new site link availabilty could be using the siteMaping.
Combine tohether a functionalty of:
i.e:
*.sitemap file
*.siteMapDataSource
and let say TreeView or Menu control.

:captain:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top