Hi

How r you all.
I want to know how to make the aspx page at the runtime. Currently my requirement is that User enter the Title of the page, description of the page and name of the page via a text box and in return he will get a aspx page (This is the new page) with the title and description in the body and name of the page in URL.
For example :
(Input)
Current URL : www.xyz.com/hhh/her.aspx
Name of the Page : First
Title of the page : This is my first page
description of the page : This is my first page
(Output)
resulting URL : www.xyz.com/hhh/First.aspx

<html>
<body>
<table>
<tr><td>This is my first page</td></tr>
<tr><td>This is my first page</td></tr>
</body>

Thanks

Recommended Answers

All 7 Replies

Are you wanting to actually output an .aspx page and write it to a file?
Or just output the code to html to be copied then pasted?

Are you asking how to write to a file?

Or how you would format the output?

I too am a bit confused by the question. If you want your page to be DYNAMIC, you can add WebServer controls, and set their properties, at runtime. Doing so can be very problematic. This article details some of the issues and workarounds:

ASP.NET Page Life Cycle and Dynamic Controls

The page in your example certainly wouldn't require any ASP.NET, why not just create a simple HTML page?

Also, do you need a server round-trip for this? JavaScript can write into an open window.

I think we need more details about what it is you're attempting before we can give meaningful answers. Please post a more specific follow-up question.

Actually i am making a wiki
In that user can update its page dynamically (i.e. at runtime)
i.e user can change the contant of the page at runtime
what i want is that when ever user click on the new page a new page is created dynamically at the runtime with the header and description blank by default. There would be a edit button on the page. As soon as he hit the edit button he will be redirected to a edit page where he enter the desired title, description of the page and name of the page. As soon as he presses the save button all the desired field like title and description should be save in the newly made web page. we can make it html page also but we need to put a Edit button each page. Please suggest me how to do that

I would suggest using a database to store the dynamic content, and then use standard web development techniques for querying a database for content.

Or, use a tool like SnippetEdit http://www.SnippetEdit.com, which allows users to directly edit their content.

Hemant,
I can understand what you are thinking.What you are trying to do is way too difficult.You'll have to create files and save files for the Response.redirect to work.You'll need an FTP to store files in the server and I think VS.NET does not offer that facility of FTP...

Check out this forum...
http://p2p.wrox.com/topic.asp?TOPIC_ID=4672
you'll understand...

I can tell you a WORK AROUND...

Things you'll have to include...
1.As Thomas said YOU'LL HAVE TO USE A DATABASE(I prefer using SQL server 2000)...
2.You'll have to provide some mode of recognizing each user(A primary key)..
3.Try keeping email address as a mode of recognition of each user..

THINGS TO DO
STEP 1:Create the database ..Keep a primary key...
My suggestion is to keep a login screen and authenticate each user..By this way you can control the properties of each user..
Check out this URL on how to provide authentication...

http://www.daniweb.com/tutorials/tutorial23605.html

STEP 2: CREATE EDIT.ASPX
Create a webform for getting values from the user for building the webpage. First time in..Show the user the building page..Keep some text boxes and mark the page Edit.aspx..Keep two buttons below the page and mark them Submit and Clear all values..

STEP 3:
When the user clicks submit button ..use Basic SQL insert statements to store the values to the database..

STEP 4:Create another page ..FINALPAGE.aspx
This page is more like a template...If you want to get the TITLE..use a Simple SQL statement and get the value from the database WHICH THE USER HAS ENTERED and assign that value to the Template..

Complete one step at a time...You should be good..

Hope it helps

Thanks for the suggestion i will try that and let you know if there is any problem

Member Avatar for zarros

Hi!

If you need this functionalities, aka programmatically insert everything in runtime instead of using strange triks you can use this library: CEFramework. It builds all the controls in a completely dynamic fashion with use of Ajax and ATLAS

Zak

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.