Dynamic Generation of ASP pages

Results 1 to 5 of 5

Thread: Dynamic Generation of ASP pages

  1. #1
    Join Date
    Dec 1969
    Posts
    218

    Default Dynamic Generation of ASP pages

    I am trying to allow my users to build custom html pages - the approach that i&#039m taking is to display a set of specific html controls and allowing the user to select (via a checkbox) which controls they wish to have on the page. Then, when they go to this page I would retrieve the asp from the database and show the user the page that they "custom built". After reading an article on this messageboard, it seems that this approach is incorrect as the asp I retrieve from the db would not be interpreted. Does anyone know of a way to get around this? I suppose I could use the FileSystemObject and redirect the user to this file however wouldn&#039t that take a lot of space on my server? Any alternative ideas would be appreciated.

  2. #2
    Cable Guest

    Default RE: Dynamic Generation of ASP pages

    I am not sure I understand what you are saying when you say that pulling data from a database will not work? I say Poppycock! It can and will work!<BR><BR>Let&#039s assume that RS is your ADO recordset that the database was set to. So if we use a template for the ASP page:<BR><BR>&#060;% If RS!chkActive = True Then %&#062;<BR>Click for Active Records &#060;input name="chkActive" type="checkbox"&#062;<BR>&#060;% End If %&#062;<BR><BR>Which you could use for each form control to be displayed or not based on your table. <BR><BR>Or you could use the check on the RS to display active records instead of all records when the user loads up the page.<BR><BR>That is, if that is what you mean by a custom web page. <BR><BR>If you mean custom web page, as in they type in their own HTML, I would suggest that you use MEMO fields. If you use this, you will have to research the Getchunk method of the recordset based on a certain ADO cursor. <BR><BR>You also could use the FileSystemObject to get an HTML template that you could read in, and then use variable substitution to fill in the blanks. But that would be much harder than just having IF..THEN..ELSE..ELSE IF..END IF and Select.Case statements to parse out the HTML based on what the user entered.

  3. #3
    Join Date
    Dec 1969
    Posts
    218

    Default RE: Dynamic Generation of ASP pages

    Cable: I&#039m storing ASP code in the database to display html. For example, the code will connect to a database and populate a select list based on the contents of the ado recordset. When I retrieve the ASP from the database, I am unable to do a response.write(RS("myASP")) because "myASP" contains &#060;% %&#062; tags and the code retrieved will not be interpreted by asp.dll. Using if..then..else..else if.. is tedious as I may have hundreds of custom html controls.<BR>

  4. #4
    Volker Guest

    Default RE: Dynamic Generation of ASP pages

    Why you are building your ASP files in the runtime? Just get all the code together, make one string and write this string to a file named whatever.asp - after this you can make a redirect to this file. Please let me know what you think about this idea.


  5. #5
    Join Date
    Dec 1969
    Posts
    218

    Default RE: Dynamic Generation of ASP pages

    Volker: Your solution is the one I wound up implementing. It works very well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •