Results 1 to 3 of 3

Thread: o02u@unb.ca

  1. #1
    o02u@unb.ca Guest

    Default o02u@unb.ca

    i&#039m trying to store asp code in a database. when i retrieve the code, IIS is not interpreting the asp tags &#060;% and %&#062; - it writes the asp code to the screen. i have the &#060;%@ LANGUAGE=VBSCRIPT %&#062; on the top of my page. anyone know how to fix my problem?<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Adding ASP Code @ Runtime (Was: o02u@unb.ca)

    I think the problem is writing code at the time of execution:<BR>The steps IIS performs:<BR>1. ASP page is requested<BR>2. ASP page executes<BR>-Writing the asp retrieved from the database will not execute since the execution already took place. (I think)<BR>A solution would be using include files:<BR>1 Store the asp in the database<BR>2. At run time write the asp code into the include file<BR>3. The next line calls the include file, which executes on the server.<BR>More on includes:<BR>http://www.4guysfromrolla.com/webtech/080199-1.shtml<BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: o02u@unb.ca

    Let me guess, you are doing this:<BR><BR>Storing something like:<BR><BR>&#060;%@LANGUAGE=VBScript%&#062;<BR>& #060;% Response.Write "Hello, World!" %&#062;<BR><BR>in a database. Then, when a page is called, you open a connection to that database, grab that ASP, and do:<BR><BR>&#060;% Response.Write objRS("ASPCode") %&#062;<BR><BR>Now, you&#039re wondering why that ASP code isn&#039t executed, correct? Well, the reason is because of the order things are processed by IIS. Remember, all ASP code must be processed by asp.dll before information is sent to the client (browser). So, when someone requests an ASP page, asp.dll resolves the ASP code into HTML and sends it off to the client. What you are doing is having asp.dll process the ASP code that displays the ASP code in the database. You would need to resend that code through asp.dll, which you couldn&#039t do via the way you&#039re trying to do. What you&#039d have to do is write the ASP code to a file, then redirect the user to that ASP file.<BR><BR>Now, let me ask WHY are you wanting to store ASP code in a database? Why not have it in a file, a .asp file, where it belongs? What are you trying to do, exactly?<BR><BR>Thanks!

Posting Permissions

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