Link to home
Start Free TrialLog in
Avatar of dontnetsanjay
dontnetsanjay

asked on

physical html files on fly asp.net vs2005

can we genrate HTL files on the fly? like client enters data in a text box his physical file is created on the server like free web page. using  from choice of master Pages.

VS2005, ASP.NET C#
Avatar of DropZone
DropZone
Flag of United States of America image

Hum... If I understand you correctly, you want to generate dynamicallly the output rendered to the user, right?  Well, this is precisely what .NET is intended for.  There are many ways to go about this.  One is to dynamically populate the page with controls as it is being prepared for rendering.  You could override the OnInit() or OnPreRender() methods and add controls at will.

My preferred method is to use dynamic templates (I am still stuck using .NET 1.1, so I have no access to master pages).  But I suppose that with master pages it is even easier.

    -dZ.
Avatar of dontnetsanjay
dontnetsanjay

ASKER

hello dropzone,
not this what i want to know
dynamically generating content for a web page thru databases text file or xml
using master pages or user controls are different concepts

create a physical html file suppose i have ntered file namein a text box say drop.html
then only we will check whether file exists or not and if ot then we create a file drop.html and adding content to that file is secondary issue which is not my query

I understand.  This is possible.

You can dynamically change the URL by using the HttpContext.RewritePath() method.  You can do this from the Application_BeginRequest() event.  At that point, you can check if the file exists, and if not, create it.  You can also set a custom ASPX page for the 404 error (file not found), and in this page, generate dynamic content depending on the original request.

It depends on what you want to do ultimately.  If you provide more details, we may be able to offer specific help.

     -dZ.
I would suggest to use a component like Rewrite.NET. This allows the user to navigate the page "drop.html", but you don't need to actually create it. You can store the content in a database and use 1 page with a literal control on it which will hold all content.

You can find more information on: http://www.15seconds.com/Issue/030522.htm
ASKER CERTIFIED SOLUTION
Avatar of DBAduck - Ben Miller
DBAduck - Ben Miller
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hey dbaduck,

thanks for the answer thats what i wanted to know and its completely clear now thanks

Sanjay