How To Host Your ASP.NET MVC Website On GoDaddy Server

Introduction


In this article, I will explain to you how to host your website to GoDaddy Server. I will also explain how you can create a database server on GoDaddy. But the process we would follow will not be only for GoDaddy, it can be followed for all other hosting services.
  
Note
To host your ASP.NET MVC website on GoDaddy, you must have Windows plan.
 
Let's start step by step.

Step 1 
 
Go to GoDaddy and login with your account credentials.

How To Host Your ASP.NET MVC Website On GoDaddy Server
 
Step 2 
 
Now, your Account page will open where you will get WEB HOSTING. Click on Manage button.

How To Host Your ASP.NET MVC Website On GoDaddy Server
 
Step 3

After that, you will get your hosting server page. From there you can add new domain for a new website or you can also add new sub domain for a new website.

How To Host Your ASP.NET MVC Website On GoDaddy Server

Step 4

Now either Add New Domain or Add Sub Domain. I am going to add new sub domain. When you will add new sub domain you will get the following page.

How To Host Your ASP.NET MVC Website On GoDaddy Server

Step 5 

After adding sub domain, your website will be live and that will look like as follows,

How To Host Your ASP.NET MVC Website On GoDaddy Server
 
Step 6

After giving the name of the website and folder name click on OK button. So it will create a folder for your website which is given in Document Root textbox. Your folder will be like as follows.

How To Host Your ASP.NET MVC Website On GoDaddy Server
 
Step 7

Now create an FTP user for your account by clicking on FTP Access.

How To Host Your ASP.NET MVC Website On GoDaddy Server

Step 8

Now click on Add FTP Account.

How To Host Your ASP.NET MVC Website On GoDaddy Server
 
Step 9

Now, fill the following form after clicking "Add New FTP Account" button. 

How To Host Your ASP.NET MVC Website On GoDaddy Server

Step 10

After completing this process, go back to your Server home page and create database on the server if you have in your project. 

How To Host Your ASP.NET MVC Website On GoDaddy Server

Step 11

Now, click on Add New Database Button.

How To Host Your ASP.NET MVC Website On GoDaddy Server
 
Step 12

Fill the following form to create the database on the Server.

How To Host Your ASP.NET MVC Website On GoDaddy Server
 
Step 13

After completing this process, let's flip to Visual Studio and open the web application which you want to host. In this article I am hosting my old article  "jTable CRUD Operation using MVC". To host your web application, first of all right click on the project and click on the Publish.

How To Host Your ASP.NET MVC Website On GoDaddy Server

Step 14

After clicking on publish button, one dialog box will open for web publishing. First of all, you have to create new profile.

How To Host Your ASP.NET MVC Website On GoDaddy Server

Give any name for your profile and click on Next button.
 
Step 15

Now, make the connection with your FTP server, provide user name password for your FTP server and Validate Connection.

How To Host Your ASP.NET MVC Website On GoDaddy Server
 
Step 16

After validation, click on Next button and apply the following settings.


Step 17

Now, click on Publish button and wait for publishing.
 
Step 18

After publishing the website, flip to GoDaddy server page again and click on ASP.NET Settings.

How To Host Your ASP.NET MVC Website On GoDaddy Server

Step 19

Write Connection String for your server side database. 

How To Host Your ASP.NET MVC Website On GoDaddy Server
 
Step 20

Open Visual Studio again and update database from package manager, again writing same connection string in web.config of your project in Visual Studio. Open package manager console and type the following command,
  1. pm>update-database   
How To Host Your ASP.NET MVC Website On GoDaddy Server

Step 21

Now, quickly open your website by my website URL that is "http://c-sharpcorner.sourabhsomani.com/". When you will run website you will get the following error,

How To Host Your ASP.NET MVC Website On GoDaddy Server

Note

This is the normal error which will come every time when you will host your website. To fix this error you have to modify your web.config on server side.
 
Step 22

To fix above error open your website directory on server. To open that click on File Manager.

How To Host Your ASP.NET MVC Website On GoDaddy Server
 
Step 23

Click on Web.Config,

How To Host Your ASP.NET MVC Website On GoDaddy Server
 
Step 24

Now click on Edit in Text Editor button which will be bottom of the Text Area.

How To Host Your ASP.NET MVC Website On GoDaddy Server

Step 25

Now add two lines in web.config. That is as follows:

How To Host Your ASP.NET MVC Website On GoDaddy Server

Step 26

Now finally, run your website with your domain. I am surfing by the following URL.
 
Output

How To Host Your ASP.NET MVC Website On GoDaddy Server
 

Conclusion


In this article, we have learned the following.
  • Hosting our ASP.NET and ASP.NET MVC website.
  • Creating FTP Client on the Server.
  • Creating database on the Server.
  • Fixing Errors when publishing our website.
  • Updating database which is located on server side using Package Manager Console.
Important Link


Similar Articles