Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - Dynamically create ASPX form

 
Thread Tools Search this Thread
Old 02-14-2006, 11:42 PM   #1
Default Dynamically create ASPX form


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
  Reply With Quote
Old 02-15-2006, 01:34 AM   #2
Jeff S
 
Posts: n/a
Default Re: Dynamically create ASPX form

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
>



  Reply With Quote
Old 02-15-2006, 01:41 AM   #3
kahtava@gmail.com
 
Posts: n/a
Default Re: Dynamically create ASPX form

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!!!..

  Reply With Quote
Old 02-15-2006, 01:17 PM   #4
=?Utf-8?B?RFdT?=
 
Posts: n/a
Default Re: Dynamically create ASPX form

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
> >

>
>
>

  Reply With Quote
Old 11-29-2007, 06:45 AM   #5
Petulka77
Junior Member
 
Join Date: Sep 2007
Posts: 2
Default

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.

Petulka77 is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Forum Jump