Reputation: 2077
I need to make my first .aspx webpage. The only server side script I need to use is an include for the header and footer. I have done this many times in php but I client does not want to use php.
How do I set up a test environment for asp.net on my localhost like I would do with WAMP to develop a php page?
Upvotes: 0
Views: 123
Reputation: 14279
There are a few ways you can go.
What version of Windows are you using? The particular capabilities of IIS depend on if you are running Win 7 or Windwos Server 2008.
Upvotes: 1
Reputation: 7703
If you're using Visual Studio as your IDE, just "run" the application and it will launch Cassini (the built in web server).
If you aren't using Visual Studio, you will need to install IIS on your local machine and run it there.
Also, do NOT use include files in an asp.net website, this will cause you many problems. You can accomplish the same thing with user controls, or adding your information in a master page.
Upvotes: 1
Reputation: 7536
I don't think that this is available for wamp by default.
This website provides a solution maybe:
But you should use the Visual Studio Express Edition which comes with a server where you deploy your sites and be able to test them.
Upvotes: 1
Reputation: 32831
In ASP.Net, you can accomplish an include that appears on every page by creating a Master Page. Then, you basically inherit from that page everywhere that you want its contents to appear.
So, for example, with one Master Page, you can accomplish the same thing as you could do with two includes -- the Master Page could have both a header and a footer.
However, you can take Master Pages much further if you wish. For example, the universal navigation is often included on a Master Page -- the horizontal menu at the top and/or a vertical nav on the left. Basically anything you want to show on many pages.
Also, you can include common server-side code in the Master Page code-behind, such as authentication.
Now that you know that what you are looking for is called a "master page", you should have to problem looking around here in SO for help. Here is one Microsoft source that might be a good starting place.
Upvotes: 2
Reputation: 25743
Visual Studio has a test environment installed by default, simply start your project by pressing F5 or going to Debug > Start. Otherwise you can use IIS which comes included with all Windows versions (at least from XP and upward). As for emulating a PHP header and footer, look at using asp.net Master Pages.
Upvotes: 2