Last post Sep 27, 2007 02:54 AM by Swati Jain
Sep 26, 2007 08:58 AM|Swati Jain|LINK
structure of first.aspx is as follows
1) It is having two textboxes with lables firstname and lastname and Ok button
2) When I click on the ok button .When I click on 'OK' button one webpage should be generated automaticaly with its name as
'Textbox value'.aspx and on other click of 'OK' button .first.aspx should be redirected to this dynamicaly generated page.
How to proceed for this ??? any reference of url
Sep 26, 2007 10:12 AM|lbriner|LINK
There are lots of variables here but you could just have a click handler that gets the values you want and write a file directly to the file system although this is probably not good practice because it would be somewhere for somebody to attack your web
site by feeding in information!! You might also get problems with security permissions when the site attempts to write the file (but you can try if you want)
public void OnClick (object sender, EventArgs e)
Another alternative (like a site I have built) is to have a database to describe the pages you want on your site, use a custom site map provider to generate your menu data and get a URL redirect module (you would have to write it) which can decide what urls
are real and what ones are pretend. It can then redirect the pretend ones to a dynamic page passing in the page id as a query parameter and getting that page to display content from the database.
Sep 27, 2007 02:54 AM|Swati Jain|LINK
For the following code to generate webpage dynamicaly ,
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Dim txtBody As String = "<html><body>test</body></html>"
Dim txtName As String = TextBox1.Text & ".aspx"
My.Computer.FileSystem.WriteAllText(Server.MapPath(txtName), txtBody, False)
.though I imported the microsoft.visualbasic.myservices .I am not getting
method, again what kind of security issues I have to face while saving this page on the webserver. How to tackle such situation?