Solved

aspx files don't work anymore

Posted on 2006-11-19
10
263 Views
Last Modified: 2008-02-01
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.Text
End Sub

</Script>

<html>
<head><title>ListBoxSelected.aspx</title></head>
<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
0
Comment
Question by:zliminator
  • 7
  • 3
10 Comments
 

Author Comment

by:zliminator
ID: 17974478
If my .net or IIS is turned off, then why does it not work on the other machine on the LAN?

Dan
0
 
LVL 6

Accepted Solution

by:
DonKyles earned 300 total points
ID: 17977790
asp.net needs to run under IIS and .net framework. if you turn one of them off, your application will not work.
asp.net runs at server side, not client side like html or javascript.
You have to config asp.net as a virtual directory under IIS.  and if you want other mathines on the network to be able to run the application, you need to set up the IIS to explor for the other and turn off the network firewall. It's a little complicate to set it up.
You need to give more detail about your site, such as what .net framwork are you running (1.1 or 2.0) how do you setup your website ect.
0
 

Author Comment

by:zliminator
ID: 17978261
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
0
 

Author Comment

by:zliminator
ID: 17978326
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...
0
 
LVL 6

Expert Comment

by:DonKyles
ID: 17981729
Did you try this yet?
<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:zliminator
ID: 17984472
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
0
 

Author Comment

by:zliminator
ID: 17984672
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
0
 
LVL 6

Expert Comment

by:DonKyles
ID: 17984787
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
0
 

Author Comment

by:zliminator
ID: 17992052
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
0
 

Author Comment

by:zliminator
ID: 17993239
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
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now