How do I set up my host-ed account to display my ASP.NET website?

I have a host-ed account because I want to host my asp.net website and they offer it for free (at least that is what is says on their site). I have uploaded my files to the server, and when I go to my webpage, it just displays the directory of files in the public_html directory on the server.

I have found no answer searching Google or even on host-ed.net.

My web site is moderntabs.host-ed.me if you would like to see for yourself.

Pleas Help Me!!!

Below is my .aspx code
<%@ Page Language="C#" Class="GMS" Debug="true"%>

using System;
using System.Web;
using System.IO;
using System.Collections;
using System.Collections.Generic;

public class GMS : IHttpHandler
{
    public string temp;
    public string html;
    List<string> files = new List<string>();

    public string GetHtmlTemplate(HttpContext context)
    {
        using (StreamReader temp = new StreamReader(context.Server.MapPath("moderntabs.html")))
        {
            return temp.ReadToEnd();
        }
    }

    public string ShowSong(HttpContext context)
    {
        context.Response.ContentType = "text/html";
        temp = GetHtmlTemplate(context);
        string title;
        string tab;
        string song = context.Request["song"];

        using (StreamReader rd = new StreamReader(context.Server.MapPath(song)))
        {
            title = rd.ReadLine();
            tab = rd.ReadToEnd();
        }
        html = @"<div class='floatleftnav'><pre>
                 <div class='stitle'>" + title + @"</div>
                 <div class='text'>" +
                 tab +
               @"</div></pre></div>";
        return temp.Replace("{CONTENT}", html);
    }

    public string ShowPage(HttpContext context, string filename)
    {
        context.Response.ContentType = "text/html";
        temp = GetHtmlTemplate(context);
        using (StreamReader page = new StreamReader(context.Server.MapPath(filename)))
        {
            html = page.ReadToEnd();
        }
        return temp.Replace("{CONTENT}", html);
    }

    public void Type(string type)
    {
        foreach (string line in File.ReadLines(@"C:\Users\Leb\Documents\Dropbox\GMS 3.3 Beta\files.txt"))
        {
            int index = line.IndexOf("/");
            string cond = line.Substring(index - 5, 1);
            if (cond == type)
            {
                files.Add(line);
            }
            else if (cond != "s" && cond != "h" && cond != "c")
            {
                files.Add("/THIS SONG COULD NOT BE LOADED.");
            }
        }
    }

    public string ListSongs(HttpContext context, string type)
    {
        context.Response.ContentType = "text/html";
        temp = GetHtmlTemplate(context);
        string songs1 = "", songs2 = "";
        switch (type)
        {
            case "s":
                Type("s");
                break;
            case "c":
                Type("c");
                break;
            case "h":
                Type("h");
                break;
            default:
                foreach (string line in File.ReadLines(@"C:\Users\Leb\Documents\Dropbox\GMS 3.3 Beta\files.txt"))
                {
                    files.Add(line);
                }
                break;
        }
        int i = 0;
        foreach(string entry in files)
        {
            string file = entry.Substring(0, entry.IndexOf("/"));
            string title = entry.Substring(entry.IndexOf("/") + 1);
            if (i <= (files.Count / 2))
            {
                songs1 = songs1 + @"<a href='index.ashx?action=song&song=Songs\" + file + "'>" + title + "</a><p>" + Environment.NewLine;
            }
            else if (i > (files.Count / 2) && i <= files.Count)
            {
                songs2 = songs2 + @"<a href='index.ashx?action=song&song=Songs\" + file + "'>" + title + "</a><p>" + Environment.NewLine;
            }
            i++;
        }

        html = @"<div class='href3'>
                 <div class='floatleftnav'>
                 <br>" + songs1 + @"</div>
                 <div class='floatrightnav'>
                 <br>" + songs2 + "</div></div>";
        return temp.Replace("{CONTENT}", html);
    }

    public void ProcessRequest(HttpContext context)
    {
        string page = "";
        string action = context.Request["action"];

        switch (action)
        {
            case "song":
                page = ShowSong(context);
                break;
            case "contact":
                page = ShowPage(context, "contact.html");
                break;
            case "help":
                page = ShowPage(context, "help.html");
                break;
            case "chords":
                page = ShowPage(context, "chordchart.html");
                break;
            case "secular":
                page = ListSongs(context, "s");
                break;
            case "christian":
                page = ListSongs(context, "c");
                break;
            case "holiday":
                page = ListSongs(context, "h");
                break;
            default:
                page = ListSongs(context, "");
                break;
        }   
        context.Response.Write(page);
    }

    public bool IsReusable
    {
        get { return false; }
    }
}

Answers


Most likely due to not having a default document of either index.htm, index.html, index.aspx, default.htm, default.html or default.aspx.

Looking at the content, you have an index.ashx, which I presume is intended to be the main page? You want that to be index.aspx page instead.


To host .NET websites you need IIS(webserver). The host-ed server may not be IIS. Try having aleast a index.html. That should work even if you don't have IIS.


Need Your Help

cassandra count (*) query error OperationTimedOut: errors={}, last_host=127.0.0.1?

count cassandra timeout cqlsh

when there is too many rows in cassandra table and I run following query in cqlsh:

How to Add SSRS Column Programmatically

c# .net reporting-services

I have a table Called EmployeeTypes which hold types of Employees, now i want to create a report using SSRS which will have something like this: