How to run asp.net webpage on the localhost - asp.net

I am just learning asp.net and have created a simple webform on visual studio. How I can run this on the localhost(xampp). Like HTML you simply put files to the server folder and it works. But when I copy all asp files it simply shows me source code?
It is stupid question but I really need answer...

ASP (ActiveX Server Pages) is a deprecated technology (superseded by ASP.NET). Thus support is not included as standard in IIS. But it can be added by using Server Manager under Roles | Web Server (IIS) and scrolling down to Role Services.
If you however mean ASP.NET then, initially, look at the Web tab of the project properties and start in VS for debug and test. Once that is working you'll need to read up on deploying ASP.NET on MSDN.

To host a ASP.Net page you usually use IIS. You are supposed to run IIS on your server and host the ASP.NET website on the IIS Management
This Article on MSDN should help you with that.
Also, you usually use visual studio to 'Publish' to the server folder, rather then copy and paste the files. In case you didn't do this: this is done by right-clicking the project in visual studio and selecting 'Publish'. Then there are a few options, you can publish to a folder (File System) and then move the published project to your server, or publish it straight to your server.

Related

How to publish Asp.net Web Application from a Web Service or Windows Form App(Not from Vs editor)

I am working on a project and we need to deploy our web projects to server but these web projects are creating dynamically by end users. so we gather all files of web project in a file. finally we need to push these files to server with publish. but how can i do without VS editor's manual publish option. do u have any website or any source that example to my aim, or if you know sth about it can you help me?
You can use Visual Studio in command line mode to do the same but assuming that you probably do not have access to VS on, your next bet would be MSBuild.
See these links that tells how to use MSBuild to publish a web project:
http://blog.m.jedynak.pl/2008/03/publishing-web-application-with-msbuild.html
How do I publish a Asp.NET web application using MSBuild?

problem with asp.net website project

I've an asp.net web site project in Microsoft Visual Studio 2010. the thing is that i need it all to copy to a flash drive, and than later to open it as simple in browsers/
I published my project to my drive, and tried to open my .aspx pages with Internet Explorer but i got some error. I really need to do it, urgent.
Somojon: You can't just open an asp.net page using a browser without having the web server (IIS, most of the time) process the page and spit out HTML that can be rendered on a browser.
You can copy the whole project (as Mrchief said) to your flash drive but before you attempt to open the project from your flash drive, you need to copy it again to a computer and configure IIS (or another web server that has support for ASP.NET).
I imagine you think you can do this because you can run your project with Visual Studio, but that's because Visual Studio comes with an the integrated web server that process the ASP .NET code and spits out the HTML to display on your browser. Bottom line is that when you move your project to another computer you will need a web server to serve your ASP .NET pages.
Copy the entire solution folder. Publish is not going to help because that publishes files that are needed to run the site, not the whole project.
This is not going to work, you should have a web server to run your ASP.NET website, IIS, IIS Express or other ASP.NET compatible web server which should execute the compiled assemblies and serve the pages to the browser.
if you simply open the pages with a browser without having a server processing them, nothing executes.

How to deploy an ASP.NET web site

I have an ASP.Net website that I built in a computer science class. I built it in Visual Studio and the solution is on my local drive. How would I deploy this to a real website?
You will need to do a few things.
You will need to get a hosting account that supports ASP.NET
From there you can use the "Publish" option from within Visual Studio under the "Build" menu option to push out a copy of the site.
When publishing you should publish in release mode.
Get hosting that supports the version of .NET and ASP.NET you have used and copy the files over.
Assuming that already you have an IIS application and web folder set up on a web server somewhere, the simplest method goes like this:
In Visual Studio, right-click on the web application project, and click Publish.
Select File System as the publish method.
Select a target location. This is where the publishable files will be placed. Use c:\pub or something similar.
Hit Publish
Once the publish operation is done, copy everything in c:\pub (or whatever target folder you used in step 3) to your web folder on the web server. Depending on your server accessibility, you may need to do this via FTP.
You might also investigate ClickOnce Deployment if your server supports it.
If you don't already have server space, you'll need to find a good hosting provider that supports ASP.NET. Google has many suggestions.

how to load webapplication on server

I have made a web application using Visual studio 2008. till now it was running on my local host..
Now i want to load it onto the server so that it can run on my company server.
How do i do that..??
Thanks
In visual studio:
Under the Build menu, select Publish
In the publish dialog, select a location to publish your application to
ex: \\server\c$\inetpub\wwwroot
Set your publish options. I reccomend using the "Only files needed to run this application" setting
Click the Publish button
You will have to mark your deployment directory as an application in IIS for IIS to run your code. See this MSDN article for details on how to do this.
You just need to copy it into the IIS directory on that server, usually c:\inetpub\wwwroot. Make sure you have asp.net installed.
You can use the project menu and copy it to a remote server (specifically the machine that will host this project, in addition a web server). Or you can just go to the remote machine, add a new site and store the .aspx pages and all related images on the web servers inetpub\wwwroot folder.

how do i connect my asp.net

Another beginner question for ASP.NET:
I'm starting an ASP.NET project in Visual Studio 2008, and would like to link it to a folder on a remote server (as in it builds/publishes to this folder). It may be my phrasing, but I cannot seem to figure out how to do this (even with Google at my side!).
I naively tried to just upload the code files to the server, but running my code produces errors related to the fact that the pages are not set up as an application.
Any help would be appreciated (or a link to a resource where i could learn more about this basic asp.net/vs08 stuff I keep running into).
On your web server the folder you copied your files into needs to be set up as an application or a virtual directory. This is done through the Internet Information Service panel found in the "Administrative Tools" off the Control Panel.
Depending what flavor of IIS you are using the procedure may differ.
Visual Studio 2008 has a publish feature. If you right-click on the web project there is a "Publish" option. You can then select where you want to Publish your files.
2 fast answers:
You can use the Publish option in Visual Studio and create a folder inside wwwroot to publish
Alternatively, you can create a simple setup program. Just add a new "web setup project" to the solution and add the results of the web site to the setup project.
And of course, have you tried googling asp.net deployment to get some help?
Good luck! :)
You will love Visual Studio 2010, which should be out in early 2010, if it follows previous versions. This would also mean an MSDN release a few months earlier. Why? Better deploy story.
As for where we are today, you can publish and have a directory created. You will have to publish to IIS instead of a directory to accomplish this. This means you have to have permissions to add a web app and publish to it.
For a directory, you will have to create the app in the IIS Manager. If you do not have access, try the IIS admin. If you cannot get them to do it, you are back to publish.

Resources