# Code displayed on opening ASP page in browser



## Siddharth_1 (Oct 17, 2012)

I dont know why but ASP isnt working properly in web browsers(IE, Firefox, Safari).
ASP code is displayed in the browser instead of the output.
I didnt do anything to any ASP settings since last time it was working.
Even a simple code like this isnt woking:



Tried clearing cache using ctrl+f5 in firefox, but that also isnt working.
Pls Help.

Guys pls reply. Pls help


----------



## Siddharth_1 (Oct 19, 2012)

No reply till now

PLS ANYONE HELP!!!


----------



## prabhu.wali (Oct 19, 2012)

i havent used asp in a long while from what i can confer you havent used any asp tags to indicate thats its an asp page apart from the file extension.


----------



## Siddharth_1 (Oct 20, 2012)

do you mean using this command before the html tag-
<%@ language="vbscript" %>
i've tried using this but no help.

If you maen something else pls tell.


----------



## prabhu.wali (Oct 21, 2012)

what editor are u using,i highly recommend using the VS2012 90 day trial


----------



## Siddharth_1 (Oct 22, 2012)

I am using notepad. I will try VS2012

12:09pm(22 oct)
I do not know why, but asp suddenly started working again!!!

3:39pm(22 oct)
ASP stoped working again. PC rebooted only once after last time it was working. No changes were done. STRANGE!!!


----------



## Vyom (Oct 22, 2012)

I wrote the following code in notepad++ and saved it as .asp file. Opened it in browser. Still I get the following output not the complete html code. (I have Visual Studio 2010 installed though).

My Code:


> <html>
> <head>
> <title>Hello World</title>
> </head>
> ...



Output:


> <% Response.Write("Hello World") %>



Which means only one thing. It's not the fault of Visual Studio. Maybe some service of windows or something.


----------



## prabhu.wali (Oct 22, 2012)

arent u supposed write the code in the ***.aspx.cs file?


----------



## Siddharth_1 (Oct 23, 2012)

^ .aspx.cs is related with VS. I am using notepad to create asp pages.


----------



## RCuber (Oct 23, 2012)

are you using classic ASP or ASP.NET? there is difference in this.  EDIT: I see from the syntax that its ASP.NET

The issue seems to be in IIS . Which version of IIS are you using?


----------



## Zangetsu (Oct 23, 2012)

@Siddharth_1 : are u directly opening the .asp file in browser..it will not work that way...your code is perfect though.

@Vyom: I suppose u also opened directly in a browser.


*Solution:* Create a folder inside C:\inetpub\wwwroot\ for e.g: Test
now open IIS Manager & navigate from there & select your .asp file & click browse...

if u directly open the .asp file in browser it will show u only the code & not the output bcoz of IIS Engine missing functionality


----------



## Siddharth_1 (Oct 23, 2012)

@Zangetu: EXCUSE ME I AM NOT USING ASP FIRST TIME AND I AM USING THE LOCALHOST COMMAND TO OPEN ASP WEB PAGES. You can see this in the pic i uploaded in the first post. I am already using asp for connecting web pages to databases and you tell me that i dont know how to open asp pages!!!

@RCuber: Its only ASP and not ASP.NET. I am using IIS 7.

At the moment i only need a way to see the output of the ASP code that i am writing. Any software which could show the output could do the work. Pls tell if you know something which could fulfill my needs.


----------



## RCuber (Oct 23, 2012)

open Programs and Features from Control Panel and select "Turn Windows Features on or off", navigate to "Internet Information Services" > "World Wide Web Services" > "Application Development Features" > Enable ASP . Also in "Web Management Tools" Check everything under "IIS6 Management Compatibility" 

then host your files and test. I will be able to reply only after 10 PM or tomorrow regarding this.


----------



## Siddharth_1 (Oct 23, 2012)

7:41pm(23 oct)-
ASP is again working. No changes to settings were made since it wasnt working. Something WIERD is going on!!!

@RCuber: ASP was already enabled. I told that ASP was working fine earlier and stooped working suddenly. I will enable the options under IIS6 Management Compatibility later when ASP stops working again.


----------



## RCuber (Oct 23, 2012)

when ever it stops working again .. check if the status of the services.


----------



## Zangetsu (Oct 23, 2012)

Siddharth_1 said:


> @Zangetu: EXCUSE ME I AM NOT USING ASP FIRST TIME AND I AM USING THE LOCALHOST COMMAND TO OPEN ASP WEB PAGES. You can see this in the pic i uploaded in the first post. I am already using asp for connecting web pages to databases and you tell me that i dont know how to open asp pages!!!


where is your .asp page saved?

and if there is any problem with IIS then re-install it again...


----------



## Siddharth_1 (Oct 24, 2012)

ASP is again not working. Whenever it is working, it stops after a reboot and again starts working after a few reboots, although no changes have been made to settings.

@RCuber: Plz explain how can i check the status when it stops working?

@Zangetsu: i changed the root file from 'C:/inetpub/wwwroot' to 'C:/Website'. But it was working fine then also.


----------



## RCuber (Oct 24, 2012)

Siddharth_1 said:


> ASP is again not working. Whenever it is working, it stops after a reboot and again starts working after a few reboots, although no changes have been made to settings.
> 
> @RCuber: Plz explain how can i check the status when it stops working?
> 
> @Zangetsu: i changed the root file from 'C:/inetpub/wwwroot' to 'C:/Website'. But it was working fine then also.



I am away from comp. 
Open services.msc and check if the iis service is working or not. This is really a weird issue i have come across.


----------



## Zangetsu (Oct 24, 2012)

can u change it to C:/inetpub/wwwroot/website and check?


----------



## Siddharth_1 (Oct 27, 2012)

will reinstalling IIS help. my current version if iis is IIS7. thinking of installing IIS7.5 Express.


----------



## Zangetsu (Oct 27, 2012)

Siddharth_1 said:


> will reinstalling IIS help. my current version if iis is IIS7. *thinking of installing IIS7.5 Express.*



yes u can try that


----------



## Siddharth_1 (Oct 28, 2012)

RCuber said:


> I am away from comp.
> Open services.msc and check if the iis service is working or not. This is really a weird issue i have come across.



oct 27-
The listing doesnt show iis service, so i guess it isnt working!

oct 28-
Now ASP is working again, but the services.msc application still doesnt show the iis service.


----------

