![]() |
|
|
|
#1 |
|
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 rishi145@gmail.com |
|
|
|
|
#2 |
|
Posts: n/a
|
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 <> wrote in message news: ups.com... >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 > |
|
|
|
#3 |
|
Posts: n/a
|
Take a look at the StreamWriter on MSDN.
http://msdn.microsoft.com/library/de...ClassTopic.asp Take a look at how to create text files, (changing .txt extension to ..aspx). http://authors.aspalliance.com/das/t...textwrite.aspx It is possible, Good luck!!!.. |
|
|
|
#4 |
|
Posts: n/a
|
Jeffs right but I want to add you would be "rebuilding the wheel". Use
response.redirect("page2.aspx") to bring up a new page. "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 > > > > <> wrote in message > news: ups.com... > >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 > > > > > |
|
|
|
#5 |
|
Junior Member
Join Date: Sep 2007
Posts: 2
|
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. ![]() |
|
|
|