ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 27th, 2002, 12:12 PM
ajyal ajyal is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 2 ajyal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Asp problem... I have no idea how to solve it....

Hi guys..

I'm building an entire portal system, and the work goes really well!

It's built using ASP language and ACCESS database...

While working, I faced a problem: When I add ASP code to a database field,and then try to "included" it to the web-page ,or call it, the browser does't show anything....
I checked the source file , and I found that it only got the code from the database, and KEPT IT AS IT WAS without actually compiling it... The code was "hidden" in the current ASP file..

What I meant actually is this:

Our mechanism works in a away that, the ASP code of each page is found in a field in a table found in the database..... example:

If the field contains : <%=response.write "my name"%>
I want the result tol be :

my name in a blank page


This also will work for all other ASP scripts and sentences that will be retrieved from the database..

What actually happens is that the browser (Internet Explorer in this case) just "copies" the code and doesn't elaborate or compile it.... In the case of the previous example, the page is white, and if you look at the source, you'll find that the ASP sentence I added is found there, but the browser didn't use it at all...


To be more clear, I tried to put HTML code in field, and then retrieve it, and everything went fine...
For example, If I've written this sentence:
"<b>my name</b>"
in a field and then retrieved it from the datbae into the current page, the result will be a page with "My name" written in BOLD!!!


The strange this is that when I add normal HTML code, everything
goes well, and the browser outputs it greatly, but it's not the same with ASP code..

I just make a connection with the database in the top of the page, and then get or retrieve the fields I need from it... If the content of the field is normal text or HTML code, everything works fine, but it it is ASP code, it doesn't work...

I'm using this methode intentionally in order to make my portal very customizable.... It would take too much time to explain it...

Now, is there any way to solve this problem???? Is there any script to make this work????

Your help would be gr8ly appreciated!!!

Thanx a lot in advance!!!


KamaL

Reply With Quote
  #2  
Old August 27th, 2002, 03:52 PM
markerdave markerdave is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Illinois, USA
Posts: 71 markerdave User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
I think the problem comes from the way that the ASP code is handled compared to HTML.

The ASP code is executed by the server and not the browser. The server actually goes through your code executing it (ie. calling your database and writing the fields contents), but then it moves to the next ASP line and doesn't deal with what was just written.

So the browser gets a page mixed with HTML, which it understands and displays correctly, and ASP, which it does not understand and simply ignores.

You may try writing the code to another page and redirecting to that one so the server will then execute the new ASP code. That suggestion may not be practical for you though.

Reply With Quote
  #3  
Old August 27th, 2002, 05:25 PM
rdoekes rdoekes is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Strasbourg, France
Posts: 181 rdoekes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 20 sec
Reputation Power: 7
Send a message via AIM to rdoekes Send a message via Yahoo to rdoekes
If you use NT, you need to install Option pack 4 in order for the code to be executed.
Also, you might wanna check your virtual directory properties (or your website properties) in your Management Console to ensure you can read and execute script in this website.

To me it seems your system is not configured for asp.

Thanks,

-Rogier
__________________
- Rogier Doekes

Reply With Quote
  #4  
Old August 28th, 2002, 11:39 AM
ajyal ajyal is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 2 ajyal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanx guys for the reply!!

I must say that my website and virtual host (my harddisk) is installed well and everything works fine.... I built tons of ASP pages and they were all good, so this is not the point..

I heard the first suggestion from different people: directing the code to a new page, and then retrieving it.... But I simply don't know how to implement it exactly!!!

Do u know any way to do it???? I hope you could help..

If there are any other suggestions, it would be gr8 to hear them!!!!!


Thanx a lot again!!!

KamaL

Reply With Quote
  #5  
Old August 28th, 2002, 12:18 PM
rdoekes rdoekes is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Strasbourg, France
Posts: 181 rdoekes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 20 sec
Reputation Power: 7
Send a message via AIM to rdoekes Send a message via Yahoo to rdoekes
I do not think you can do this, since the server expects the code in the page. Yes you can dynamically create content from a database, but you cannot execute code out of the database.
This is because the asp code is server side and is compiled first, then page building top-down with the lines of code in there.
What you ask is for the parser to
1. first compile the code
2. create the page, execute the code in the page
3. compile again
4. execute asp code from the database, which is already written to the browser

Step 3 and 4 cannot be done.

Reply With Quote
  #6  
Old September 12th, 2002, 03:49 AM
sujijoe sujijoe is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 1 sujijoe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi
If you are using ASP 3.0 then why don't use server.execute?

Reply With Quote
  #7  
Old December 17th, 2002, 11:48 AM
jgroom jgroom is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Nelson - UK
Posts: 5 jgroom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 59 sec
Reputation Power: 0
I do something similar and after reading the ASP code from the DB I write it to the screen with Response.Write

i.e.

sql = "SELECT code FROM table"
Set rs = db.Execute(sql)
Response.Write rs("code")

Hope that helps in your case.

Reply With Quote
  #8  
Old December 19th, 2002, 11:44 PM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 7
Send a message via MSN to aspnewbie
Here's some really stupid questions, but when all else fails ...

Your asp pages are saved on a webserver, heh? and you're typing in http://webserveraddress/aspfilename.asp?

Just checking.

Reply With Quote
  #9  
Old December 24th, 2002, 04:50 PM
neurosis neurosis is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 6 neurosis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You could not parse asp code dynamicaly

the only tink you could not is output in html your asp code

with server.htmlencode(your db field)

but it will not produce what you want

instead of keeping <%=response.write "my name"%>
in your db field only keep "my name" and do your response.write in your asp pages...

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > Asp problem... I have no idea how to solve it....


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT