[RESOLVED] Localhost - problems with exentions
i made a simple asp page, default.aspx. I saved it to localhost and ran it, i got the error "Server Application Unavailable"
I changed the extention to .asp, and it ran, but the script didnt work.
here is the script:
asp Code:
<head>
<title>Test Page</title>
</head>
<body>
<form id="form1" method='post'>
<div>
<input type="text" name="myname" />
<input type="submit" name="submit" value="Submit" />
</div>
</form>
<%
Dim myname
myname = Request.Form("myname")
Response.Write("Hello " & myname)
%>
</body>
</html>
Re: Localhost - problems with exentions
Moved
Where is your runat="server" in your form?
Re: Localhost - problems with exentions
Quote:
saved it to localhost
....
You just saved it, or created a virtual directory?
Sounds like you tried to create a page in text editor not using VS? Good idea, just make sure all is in place (.net, virtual directory, folder permission, etc)
Re: Localhost - problems with exentions
rob helped me a little, he got me a vitural dir, i am just getting the error:
"Failed to access IIS metabase."
Re: Localhost - problems with exentions
Make sure your web.config looks something like this...
vb Code:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<appSettings />
<connectionStrings />
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="false" />
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows" />
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="default.aspx" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
Re: Localhost - problems with exentions
yeah it does
(off topic: one more post cout for me :D)
Re: Localhost - problems with exentions
Also, noticed you are missing some stuff on your page...
vb Code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="default.aspx.vb" Inherits="_default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
'...
Re: Localhost - problems with exentions
register .net in iis? (aspnet_regiis -i)
Make sure that Windows Authentication is enabled for the Virtual Directory in IIS. You will get this error if it is unchecked. To see if it's enabled, click on the Directory Security tab, click Edit under Access control, and place a check in the Intergrated Windows Security box. You MUST restart IIS for the changes to take effect!
Right-click on the virtual directory (or Default Web Site), go to properties and click on the Configuration button. Under the Mappings Tab, make sure .aspx and other .NET related extentions are listed. If not, I believe you'll have to run the aspnet_regiis.exe utility.
This shouldn't affect your problem, but it might. Under the Documents Tab, it seems you have to manually add index.aspx or default.aspx. Again, this probably isn't causing your problem UNLESS you are not supplying the page name in the address bar when navigating.
If you're using Windows 2003, make sure you've enabled ASP.NET in IIS Manager.
Lastly, make sure the ASPNET account has proper rights for the directory and it's subs.
Re: Localhost - problems with exentions
Quote:
Originally Posted by StrangerInBeijing
register .net in iis? (aspnet_regiis -i)
Make sure that Windows Authentication is enabled for the Virtual Directory in IIS. You will get this error if it is unchecked. To see if it's enabled, click on the Directory Security tab, click Edit under Access control, and place a check in the Intergrated Windows Security box. You MUST restart IIS for the changes to take effect!
Right-click on the virtual directory (or Default Web Site), go to properties and click on the Configuration button. Under the Mappings Tab, make sure .aspx and other .NET related extentions are listed. If not, I believe you'll have to run the aspnet_regiis.exe utility.
This shouldn't affect your problem, but it might. Under the Documents Tab, it seems you have to manually add index.aspx or default.aspx. Again, this probably isn't causing your problem UNLESS you are not supplying the page name in the address bar when navigating.
If you're using Windows 2003, make sure you've enabled ASP.NET in IIS Manager.
Lastly, make sure the ASPNET account has proper rights for the directory and it's subs.
i have windows (server) 2003, and the scripts work just fine.I have tried just about everything you said.. and nothing...
Re: Localhost - problems with exentions
Seems like a pretty common problem: Google is your friend too
Re: Localhost - problems with exentions
So then you had it correct :thumb:
aspnet_regiis -i
Ps, He said Google is not his friend so he had to post the thread. :D
Re: Localhost - problems with exentions
Are you even using Visual Studio? How did you 'publish' in the first place?
Re: Localhost - problems with exentions
He is using notepad I believe, hence the missing asp code on the page.
Re: Localhost - problems with exentions
so do i put "aspnet_regiis -i" in the ISAPI filter tab of my website?
Re: Localhost - problems with exentions
No you need to run it from the commandline. The full path may be required though.
Re: Localhost - problems with exentions
what would be the full path?
Re: Localhost - problems with exentions
The fool path would be everything including the root drive :lol: :p
XP Framework 1.1:
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322
XP/Vista 2.0:
C:\Windows\Microsoft.NET\Framework\v2.0.50727
Re: Localhost - problems with exentions
so what do i enter into command line? do i need to change the directory to get there? then enter the line?
Re: Localhost - problems with exentions
C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -i
from the run box and press enter. A dos window will popup showing the reregistering of iis.
Re: Localhost - problems with exentions