473,386 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

Feb 15 '06 #1
3 1741
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

<ri******@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro 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

Feb 15 '06 #2
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!!!.. :)

Feb 15 '06 #3
DWS
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

<ri******@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro 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


Feb 15 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image...
4
by: Bas Groeneveld | last post by:
I am developing an ASP.NET application part of which consists of a data entry wizard defined by entries in a data table - ie the controls on each page of the wizard are determined by definitions in...
1
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My requirement is to load the web user controls on the web...
1
by: CS Wong | last post by:
Hi, I have a page form where form elements are created dynamically using Javascript instead of programatically at the code-behind level. I have problems accessing the dynamically-created...
2
by: Chad | last post by:
I have a problem that I am desperate to understand. It involves dynamically adding controls to a Table control that is built as a result of performing a database query. I am not looking to...
1
by: Reza Nabi | last post by:
Bakground: I have a webform (LoadCtl.aspx) which loads the user control to a placeholder dynamically based on the ctlName querystring passed in the URL. Webform (LoadCtl.aspx) also passes a...
4
by: Kevin Blount | last post by:
bit long winded this one, so stick with me: I'm trying to create a form that can go to one of 3 places, depending on various elements. My form control looks like this: <form runat="server"...
9
by: netasp | last post by:
hi all, how can I populate one aspx form when page is loading based on page ID? for example: loading page A (to search for VB code) would display labels and texboxes, dropdown lists all related...
7
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within the aspx file, and can dynamically manipulate a...
3
by: Allen Chen [MSFT] | last post by:
Hi Richard, Quote from Richard================================================== However I also want to be able to remove the panes. I have tried to include this, but find that when I first...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.