ANSWERS: 1
  • You cannot simply run an ASPX page in your browser window - ASP.NET and ASP are server side technologies and require some processing on a server platform (Internet Information Server in this case). In the case of ASP.NET the rabbit hole goes deeper - you also need the .NET runtime installed (I am assuming you already have this since you are saving VB.NET code - but to be complete I will outline the steps for this as well in case you have not done it yet). Here Goes... aspx files run in the ASP.NET pipeline which is hosted in IIS. When you make a request to execute a page written in ASP.NET IIS starts up the .NET CLR and loads the ASP.NET assembly to start the pipeline - it then uses the page directive precompile your assembly and load it into the CLR then executes the Page starting with the OnInit override. You cannot simply view an ASPX page unless it is placed in either a virtual directory of IIS or a WebSite in IIS with the ASP.NET and .NET Framework runtimes installed. So here is what you have to do... (this is assuming you have written the code using .NET 2.0) 1: If you have not already done so, install the .NET Runtime - get it here (from Microsoft)... http://www.microsoft.com/downloads/details.aspx?FamilyID=FE6F2099-B7B4-4F47-A244-C96D69C35DEC&displaylang=en 2: after installing the runtime - register ASP.NET (sometimes you have to do this - sometimes it just works - this is here to make sure it is installed with IIS) You do this by first opening the .NET Command Prompt Go To Start->All Programs->Microsoft.NET SDK v2.0->SDK Command Prompt This will open a command prompt... Next type the following into the command prompt... aspnet_regiis /i Wait for the installation in the command prompt to finish... Doing this will register .NET with IIS (the .aspx extension) Once that is done close the command prompt and open IIS Go To: Start->Administrative Tools->Internet Information Services The IIS Plugin for the Microsoft Managment Console will open up. In the Management Console you will need to create a virtual directory (assuming you are using Windows 2000 or XP if you are using Server 2000 or 2003 you can create a whole new website - I will stick with a virtual directory for now - for more information Check out the IIS documentation on MSDN). To Create a virtual directory in IIS.. Open the default web site Right Click on the Default web site and select New-> Virtual Directory The virtual directory creation wizard will open up. Click next to get past the title screen of the wizard. Give the Virtual Directory an alias we will call this one myvirtualdirectory type in MyVirtualDirectory and click "Next" now create a physical file location (this is where you will drop your aspx file when you are finished and want to view it) create a new folder on the root of the C drive and call it C:MyVirtualDirectory (you can place this folder anywhere - but for simplicity - we will put it in the root of our harddrive. enter this path in the Directory textbox and click next you will be presented with options for what you want the virtual directory to allow - the defaults are all you will need to run an ASP.NET page (Read and Run Scripts (such as ASP). Leave this as is and click next. Click finish and you are done creating your virtual directory. Now add your aspx pages and web.config to the virtual directory (you need a web config to configure your website) Information on web.config can be found here... http://www.sitepoint.com/article/web-config-file-demystified you will also need the site dll in a bin folder in this directory - make sure you have this if not - then compile the site first and add it. There is a lot here I know you can find more information on this link... http://msdn2.microsoft.com/en-us/asp.net/aa336567.aspx HTH

Copyright 2023, Wired Ivy, LLC

Answerbag | Terms of Service | Privacy Policy