Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7857667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:06:18+00:00 2026-06-02T21:06:18+00:00

I’ve just started working through a ASP.NET C# guide to assist me with an

  • 0

I’ve just started working through a ASP.NET C# guide to assist me with an internship I’m starting next week. I’m familiar with OO, but never used C# or ASP.NET. In the beginning of this tutorial, I’ve created a simple webpage that is supposed to analyze the interest from an IRA account. There are two buttons, which are tagged with event handlers that refer to the C# code-behind file. I’m receiving the following errors from the browser, after compiling and running the program:

C:\Users\Kyle\Documents\Visual Studio 2010\WebSites\WebSite2\Default.aspx(49) : error BC30456: ‘btnCalculate_click’ is not a member of ‘ASP.default_aspx’.

        AddHandler __ctrl.Click, AddressOf Me.btnCalculate_click
                                           ~~~~~~~~~~~~~~~~~~~~~

C:\Users\Kyle\Documents\Visual Studio 2010\WebSites\WebSite2\Default.aspx(52) : error BC30456: ‘btnClear_Click’ is not a member of ‘ASP.default_aspx’.

        AddHandler __ctrl.Click, AddressOf Me.btnClear_Click
                                           ~~~~~~~~~~~~~~~~~

Here is my .aspx file:

    <xmlns="http://www.w3.org/1999/xhtml">
<html>
<head runat="server">
<title>Chapter 2: Future Value</title>
<style type ="text/css">
.style1 
{
    color: #0000FF;
    font-size: x-large;
}
.style2 
{
    width:100%;
}
.style3 
{
    width: 140px;
    height: 23px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<span class="style1"><strong>401K Future Value</strong></span> <br /> <br />
<table class = "style2">
    <tr>
            <td class="style3">Montly investment</td>
            <td><asp:DropDownList ID="ddlMonthlyInvestment" runat="server" Width="106px"></asp:DropDownList></td>
        </tr>

        <tr>
            <td class="style3">Annual interest rate</td>
            <td><asp:TextBox ID="txtInterestRate" runat="server" Width="100px">6.0</asp:TextBox></td>
        </tr>

        <tr>
            <td class="style3">Number of years</td>
            <td><asp:TextBox ID="txtYears" runat="server" Width="100px">10</asp:TextBox></td>
        </tr>

        <tr>
            <td class="style3">Future Value</td>
            <td><asp:Label ID="lblFutureValue" runat="server" Font-Bold="true"></asp:Label></td>
        </tr>

        <tr>
        <td class="style3">
            <asp:Button ID="Calculate" runat="server" onclick="btnCalculate_click" Text="Calculate" />
            </td>
        <td>
            <asp:Button ID="Clear" runat="server" onclick="btnClear_Click" Text="Clear" />
            </td>                        
        </tr>
</table>


</div></form>
</body>  
</html>

And here is my code-behind file:

    using System;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public partial class _Default : System.Web.UI.Page
    {

protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
        for (int i = 50; i <= 500; i += 50)
            ddlMonthlyInvestment.Items.Add(i.ToString());
}

protected void btnCaluculate_Click(object sender, EventArgs e)
{
    if (IsValid)
    {
        int monthlyInvestment = Convert.ToInt32(ddlMonthlyInvestment.SelectedValue);
        decimal yearlyInterestRate = Convert.ToDecimal(txtInterestRate.Text);
        int years = Convert.ToInt32(txtYears.Text);

        int months = years * 12;
        decimal monthlyInterestRate = yearlyInterestRate / 12 / 100;

        decimal futureValue = this.CalculateFutureValue(monthlyInvestment, monthlyInterestRate, months);

        lblFutureValue.Text = futureValue.ToString("c");

    }
}

protected decimal CalculateFutureValue(int monthlyInvestment, decimal monthlyInterestRate, int months)
{
    decimal futureValue = 0;
    for (int i = 0; i < months; i++)
    {
        futureValue = (futureValue + monthlyInvestment) * (1 + monthlyInterestRate);
    }
    return futureValue;
}

protected void btnClear_Click(object sender, EventArgs e)
{
    ddlMonthlyInvestment.SelectedIndex = 0;
    txtInterestRate.Text = "";
    txtYears.Text = "";
    lblFutureValue.Text = "";
}

}

Could someone please let me know why these errors are popping up? I’ve retyped both of these from the source. Could there be a setting that I might need to have changed? I’ve never used VS2010, so I’m not 100% familiar with it, either.

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T21:06:20+00:00Added an answer on June 2, 2026 at 9:06 pm

    In your ASPX file I do not see your @Page and CodeFile declarations.

    Based on your question it would look something like this:

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
    

    Also, you should might want to read up on partial classes since this is how the code-behind model works:

    http://msdn.microsoft.com/en-us/library/wa80x488(v=vs.100).aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
Seemingly simple, but I cannot find anything relevant on the web. What is the
I want to construct a data frame in an Rcpp function, but when I
I'm working with an upstream system that sometimes sends me text destined for HTML/XML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.