Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all articles
Browse latest Browse all 3509

Server Error / Parser Error

$
0
0

Hi,

Sorry if this is not in the correct forum as I am new to asp.net forums.

I am new to ASP.net and wish to learn web application development. I have created an ASP.NET application in Visual Studio 2012 Professional and published it to my website (yes it's windows hosted) and I get a server/parser error that I do not fully understand.

Server Error in '/' Application.

Parser Error 
  Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

 Parser Error Message: Could not load type 'OscilloscopeFrequencyCalculator._default'.

Source Error: 



Line 1:  <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="OscilloscopeFrequencyCalculator._default" %>
Line 2:  
Line 3:  <!DOCTYPE html>

 Source File:  /area51/online_ofc/Default.aspx    Line:  1 


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18447 

The C# file is:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace OscilloscopeFrequencyCalculator
{
    public partial class _default : System.Web.UI.Page
    {
        double dFrequency;          //variable to hold frequency
        double dTimePerDivision;    //time per devistion
        double dNumberOfDivisions;  //number of divisions for a cycle
        double dPeriod;             //Time a full cycle takes

        protected void Page_Load(object sender, EventArgs e)
        {
            //Sets the background colour of the page
            PageBody.Attributes.Add("bgcolor", "#339966");
        }

        protected void btnCalculate_Click(object sender, EventArgs e)
        {
            try
            {
                //put the values into the variables
                dTimePerDivision = double.Parse(txtTimePerDivision.Text);
                dNumberOfDivisions = double.Parse(txtNumberOfDivisions.Text);

                dPeriod = (dNumberOfDivisions * dTimePerDivision);


                //conversion for seconds, milliseconds, microseconds and nanoseconds
                if (rblTime.SelectedIndex == 0)
                {
                    dTimePerDivision /= 1;
                    txtPeriod.Text = string.Format("{0:0.00}", dPeriod) + " S";
                }
                else if (rblTime.SelectedIndex == 1)
                {
                    dTimePerDivision /= 1000;
                    txtPeriod.Text = string.Format("{0:0.00}", dPeriod) + " mS";
                }
                else if (rblTime.SelectedIndex == 2)
                {
                    dTimePerDivision /= 1000000;
                    txtPeriod.Text = string.Format("{0:0.00}", dPeriod) + " μS";
                }
                else if (rblTime.SelectedIndex == 3)
                {
                    dTimePerDivision /= 1000000000;
                    txtPeriod.Text = string.Format("{0:0.00}", dPeriod) + " nS";
                }


                //calculate the frequency in Hertz, kilohertz and megahertz
                dFrequency = (1.0 / dTimePerDivision) / dNumberOfDivisions;

                if (rblFrequency.SelectedIndex == 0)
                {
                    txtFrequency.Text = dFrequency.ToString() + " Hz";
                }
                else if (rblFrequency.SelectedIndex == 1)
                {
                    dFrequency /= 1000;
                    txtFrequency.Text = dFrequency.ToString() + " KHz";
                }
                else if (rblFrequency.SelectedIndex == 2)
                {
                    dFrequency /= 1000000;
                    txtFrequency.Text = dFrequency.ToString() + " MHz";
                }
            }
            catch (Exception)
            {
            }
        }

        protected void btnReset_Click(object sender, EventArgs e)
        {
            //Resets all the selection boxes to there default states
            rblTime.SelectedIndex = 0;
            rblFrequency.SelectedIndex = 0;
            txtTimePerDivision.Text = "";
            txtNumberOfDivisions.Text = "";
            txtFrequency.Text = "";
            txtPeriod.Text = "";
        }
    }
}

Can anyone help me please. Cry
 


Viewing all articles
Browse latest Browse all 3509

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>