zliminator
asked on
aspx files don't work anymore
I have an html file called index.htm which I have a link to sample aspx files. At one time it worked, but now when I try to run the following aspx file:
<Script Runat="Server">
Sub Button_Click( s As Object, e As EventArgs )
lblSelectedIndex.Text = lstProducts.SelectedIndex
lblSelectedItem.Text = lstProducts.SelectedItem.T ext
End Sub
</Script>
<html>
<head><title>ListBoxSelect ed.aspx</t itle></hea d>
<body>
<form Runat="Server">
<asp:ListBox
ID="lstProducts"
Runat="Server">
<asp:ListItem Text="Hair Dryer" />
<asp:ListItem Text="Shaving Cream" Selected="True"/>
<asp:ListItem Text="Electric Comb"/>
</asp:ListBox>
<asp:Button
Text="Pick A Product!"
OnClick="Button_Click"
Runat="Server" />
<hr>
Selected Index:
<asp:Label
ID="lblSelectedIndex"
Runat="Server" />
<p>
Selected Item:
<asp:Label
ID="lblSelectedItem"
Runat="Server" />
</form>
</body>
</html>
all it prints out is a line across the top and the text: "Selected Index: Selected Item:" Its like nothing inside the tags work. When I try to run it from c:\inetpub\wwwroot by typing in my brower: http://localhost/TextBox.aspx I get:
Server Error in '/' Application.
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested Url: /TextBox.aspx
It was working fine at one time. I'm running this on a win2k box and the same thing happens on an ME machine on my LAN.
Dan
<Script Runat="Server">
Sub Button_Click( s As Object, e As EventArgs )
lblSelectedIndex.Text = lstProducts.SelectedIndex
lblSelectedItem.Text = lstProducts.SelectedItem.T
End Sub
</Script>
<html>
<head><title>ListBoxSelect
<body>
<form Runat="Server">
<asp:ListBox
ID="lstProducts"
Runat="Server">
<asp:ListItem Text="Hair Dryer" />
<asp:ListItem Text="Shaving Cream" Selected="True"/>
<asp:ListItem Text="Electric Comb"/>
</asp:ListBox>
<asp:Button
Text="Pick A Product!"
OnClick="Button_Click"
Runat="Server" />
<hr>
Selected Index:
<asp:Label
ID="lblSelectedIndex"
Runat="Server" />
<p>
Selected Item:
<asp:Label
ID="lblSelectedItem"
Runat="Server" />
</form>
</body>
</html>
all it prints out is a line across the top and the text: "Selected Index: Selected Item:" Its like nothing inside the tags work. When I try to run it from c:\inetpub\wwwroot by typing in my brower: http://localhost/TextBox.aspx I get:
Server Error in '/' Application.
--------------------------
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested Url: /TextBox.aspx
It was working fine at one time. I'm running this on a win2k box and the same thing happens on an ME machine on my LAN.
Dan
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I just want to develop on my Win2k machine and then once I put it on my website, I can see it work from any machine, on my LAN or elsewhere.
Under Administrative Tools, I have an applet called MS .NET framework 2.0 config, so I'm assuming I have 2.0.
Under Computer Mgmt, System Tools, Local Users & Groups, Users I have an account called ASPNET with Users & Administrators in the Members Of tab.
As far as my website (www.hampleman.com), I just have a file called Index.htm which just has one hyperlink to whatever aspx file I'm trying to run and I use FP.
Hope this helps. I'll post anymore relevant info if I think of it.
Dan
Under Administrative Tools, I have an applet called MS .NET framework 2.0 config, so I'm assuming I have 2.0.
Under Computer Mgmt, System Tools, Local Users & Groups, Users I have an account called ASPNET with Users & Administrators in the Members Of tab.
As far as my website (www.hampleman.com), I just have a file called Index.htm which just has one hyperlink to whatever aspx file I'm trying to run and I use FP.
Hope this helps. I'll post anymore relevant info if I think of it.
Dan
ASKER
Also, under Computer Mgmt, Services & Apps, IIS I have an aspnet_client directory for both default website and administrative website.
Under System Tools, Shared Folders, Shares I have...
Under System Tools, Shared Folders, Shares I have...
Did you try this yet?
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
ASKER
the directory I was running it from didn't even have a Web.Config file, but I made the change and still nothing. It was set to "RemoteOnly".
Dan
Dan
ASKER
Where are you supposed to see the errors if you set the Custom Errors Mode to "Off"?
Also, I looked in Component Services and found that ASP.NET state service was stopped. I set it to start on reboot, rebooted and still nothing. I also went to Shared Folders, Shares and added aspnet_wp account in the share permissions tab of the shared directory where I am running the app. Nothing, I'm stumped. I'm raising the point value.
Dan
Also, I looked in Component Services and found that ASP.NET state service was stopped. I set it to start on reboot, rebooted and still nothing. I also went to Shared Folders, Shares and added aspnet_wp account in the share permissions tab of the shared directory where I am running the app. Nothing, I'm stumped. I'm raising the point value.
Dan
How did you create .NET web application?
Did you use Visual Studio 2005 to create it?
your should see something like this in IIS Manager
- Internet Information Services
- Website
- Default Website
+ IISHelp
- your asp.net application (this should be a virtual directory)
- App_Code
- aspnet_client
Right Column you should see all your files
App_Code (folder)
aspnet_client (folder)
TextBox.aspx
TexBox2.aspx
default.html
web.config
If you dont' see anything like this follow these steps:
1. right click on Default Web Site
2. Select New --> Virtual Directory --> next
3. give the site name --> next
4. browse.. the website folder --> next
5. Click Next (virtual Directory Access Permissions)
6. Finish
7. Right click on the site that you just created and select properties
8. Under the Application Settings - Application name: --> click on Create Button
9. Select Scripts only for Execute permissions: and click apply
10. go to Documents tab under 'Enable default content page' click remove to remove all list items
11. Click Add.. button and type default.html into the text box and OK
12. Go to Directory Security under Authentication and access control click Edit... button
13. Unser the Enable anonymous access, make sure that the user name is machine administrator account
14. check on Integrated Windows authentication and click ok
15. Go to ASP.NET tab and make sure that ASP.NET version is 2.0.50727
16. Click Ok to finish
Did you use Visual Studio 2005 to create it?
your should see something like this in IIS Manager
- Internet Information Services
- Website
- Default Website
+ IISHelp
- your asp.net application (this should be a virtual directory)
- App_Code
- aspnet_client
Right Column you should see all your files
App_Code (folder)
aspnet_client (folder)
TextBox.aspx
TexBox2.aspx
default.html
web.config
If you dont' see anything like this follow these steps:
1. right click on Default Web Site
2. Select New --> Virtual Directory --> next
3. give the site name --> next
4. browse.. the website folder --> next
5. Click Next (virtual Directory Access Permissions)
6. Finish
7. Right click on the site that you just created and select properties
8. Under the Application Settings - Application name: --> click on Create Button
9. Select Scripts only for Execute permissions: and click apply
10. go to Documents tab under 'Enable default content page' click remove to remove all list items
11. Click Add.. button and type default.html into the text box and OK
12. Go to Directory Security under Authentication and access control click Edit... button
13. Unser the Enable anonymous access, make sure that the user name is machine administrator account
14. check on Integrated Windows authentication and click ok
15. Go to ASP.NET tab and make sure that ASP.NET version is 2.0.50727
16. Click Ok to finish
ASKER
I created a project with VS C# called test3 and then found a virtual directory under Default Web Sites called test3. It had the following files in it:
AssemblyInfo.cs
Global.asax
Global.asax.cs
Global.asax.resx
test3.csproj
test3.csproj.webinfo
test3.vsdisco
Web.config
WebForm1.aspx
WebForm1.aspx.cs
WebForm1.aspx.resx
can I call my aspx file from the WebForm1.aspx and it should work? Or do I need to make those changes you mentioned (1 - 16)? Also, I wasn't sure about step #13.
Dan
AssemblyInfo.cs
Global.asax
Global.asax.cs
Global.asax.resx
test3.csproj
test3.csproj.webinfo
test3.vsdisco
Web.config
WebForm1.aspx
WebForm1.aspx.cs
WebForm1.aspx.resx
can I call my aspx file from the WebForm1.aspx and it should work? Or do I need to make those changes you mentioned (1 - 16)? Also, I wasn't sure about step #13.
Dan
ASKER
I can call my test aspx files from my VS app and it works. I'm still not sure how it all works but I can take it from here. Thanks.
Dan
Dan
ASKER
Dan