Solved

aspx files don't work anymore

Posted on 2006-11-19
10
265 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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
 

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
If-Then-Else ASP problem 6 60
Edit a page at wix.com 8 50
move widget title down 4 18
Wordpress plugins not working in html 3 23
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to dynamically set the form action using jQuery.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

770 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