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-15-2006, 12:42 AM   #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, 02: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
>





Jeff S
  Reply With Quote
Old 02-15-2006, 02: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!!!..



kahtava@gmail.com
  Reply With Quote
Old 02-15-2006, 02: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
> >

>
>
>



=?Utf-8?B?RFdT?=
  Reply With Quote
Old 11-29-2007, 07: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
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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to burn copy CD/DVD and create Data/Audio/Video Disc? dvdloveri Software 6 07-27-2009 07:58 AM
how to create an new webform with codebehind dynamically using c# in asp.net?. krish200 Software 1 12-18-2007 09:16 PM
html form POST to aspx page, then to SQL db ikeson General Help Related Topics 0 10-09-2007 03:47 AM
Dynamically adding WebUserControl in aspx page sureshsekaran Software 2 10-18-2006 08:20 AM
I just want to know how to create a new webform in asp .net dynamically... nkamalraj Software 1 05-28-2006 04:28 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46