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 7540639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:41:29+00:00 2026-05-30T07:41:29+00:00

Here is my issue. I have an assignment where I have to write a

  • 0

Here is my issue. I have an assignment where I have to write a simple ASPX page the lets the users input into 3 text boxes and click a calculate button which will return the result of how many items are requested. Here’s what I have. The line
is suppose to save the users input into the ID txtPlateQty and in the C# code below, which is a separate file in visual studio 2010, I want to take the users input and convert it into an int for calculations. The issue is in the C# file the “Convert.ToInt32(txtPlateQty.Text); does not recognize the variable “txtPlateQty” as if it’s out of scope. This is a assignment for a class and my professor has and identical example and his works while mine does not. If anyone could shed some light onto what is causing this issue I would be very grateful.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CashRegister.aspx.cs" Inherits="ProjectX.CashRegister" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="txtPlateQty" runat="server"></asp:TextBox>
        <asp:TextBox ID="txtSomethingElse1" runat="server"></asp:TextBox>
        <asp:TextBox ID="txtSomethingElse2" runat="server"></asp:TextBox>
        <asp:Button ID="btnCalculate" runat="server" Text="Button" onclick="btnCalculate_Click" />
    </div>
    </form>
</body>
</html>

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


public partial class CashRegister : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void btnCalculate_Click(object sender, EventArgs e)
    {
        int plateQty = Convert.ToInt32(txtPlateQty.Text);
        int somethingElse1 = Convert.ToInt32(txtSomethingElse1.Text);
        int somethingElse2 = Convert.ToInt32(txtSomethingElse2.Text);
    }
}

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <system.web>
    <compilation defaultLanguage="C#" debug="true"></compilation>
  </system.web>
</configuration>
  • 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-05-30T07:41:32+00:00Added an answer on May 30, 2026 at 7:41 am

    Your CashRegister.aspx.cs code behind should look some thing like:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    public partial class CashRegister : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
        protected void btnCalculate_Click(object sender, EventArgs e)
        {
            int plateQty = Convert.ToInt32(txtPlateQty.Text);
            int somethingElse1 = Convert.ToInt32(txtSomethingElse1.Text);
            int somethingElse2 = Convert.ToInt32(txtSomethingElse2.Text);
        }
    }
    

    Your CashRegister.aspx markup should look like:

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="CashRegister.aspx.cs" Inherits="CashRegister" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:TextBox ID="txtPlateQty" runat="server"></asp:TextBox>
            <asp:TextBox ID="txtSomethingElse1" runat="server"></asp:TextBox>
            <asp:TextBox ID="txtSomethingElse2" runat="server"></asp:TextBox>
            <asp:Button ID="btnCalculate" runat="server" Text="Button" OnClick="btnCalculate_Click" />
        </div>
        </form>
    </body>
    </html>
    

    Web.config

    <?xml version="1.0"?>
    
    <!--
      For more information on how to configure your ASP.NET application, please visit
      http://go.microsoft.com/fwlink/?LinkId=169433
      -->
    
    <configuration>
    
        <system.web>
            <compilation debug="false" targetFramework="4.0" />
        </system.web>
    
    </configuration>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the issue: I have a hook in IE that reacts on WebBrowser.OnNavigateComplete2 event
Here's the issue: I have 2 data contexts that I would like to do
Here's the issue: I have a list of App names that I want to
So I'm not to OOP in PHP. Here is my issue I have a
Having an issue here that I have tried everything I can think of but
I have a rather annoying issue here I can't get my CheckBox CheckedChange event
I have a curious issue here In my ejbCreate() method from where i insert
Hey guys I have a little issue here. I have a panel where I
hello fellow java developers. I'm having a bit of an issue here. I have
Here is the issue I am having: I have a large query that needs

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.