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

The Archive Base Latest Questions

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

I installed the Asp.net Ajax toolkit. In my site I use the NummericUpDown from

  • 0

I installed the Asp.net Ajax toolkit. In my site I use the NummericUpDown from that toolkit.
Now, I want that a label changes when the NummericUpDown Textboxes changes. I try to use JavaScript for this, but I always get the following error:

'ASP.orders_aspx' does not contain a definition for 'changeAmount' and no extension method 'changeAmount' accepting a first argument of type 'ASP.orders_aspx' could be found (are you missing a using directive or an assembly reference?)

This is my code:

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="orders.aspx.cs" Inherits="orders" Title="the BookStore" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">

    <script type="text/javascript">

        function changeAmount()
        {
            var amount = document.getElementById("txtCount");
            var total = 10 * amount.value;

            document.getElementById("lblPrice").value = total;
        }


    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <ajaxToolkit:ToolkitScriptManager runat="Server" EnablePartialRendering="true" ID="ScriptManager1" />

    <h1 id="H1" runat="server">
        Bestellen</h1>

    <asp:Panel ID="pnlZoeken" runat="server" Visible="true">

        <asp:ObjectDataSource ID="objdsSelectedBooks" runat="server" OnSelecting="objdsSelectedBooks_Selecting"
            TypeName="DAL.BooksDAL"></asp:ObjectDataSource>
        <h3>
            Overzicht van het gekozen boek</h3>
        <asp:FormView ID="fvBestelBoek" runat="server" Width="650">
            <ItemTemplate>
                <h3>
                    Aantal boeken bestellen</h3>
                <table width="650">
                    <tr class="txtBox">
                        <td>
                            Boek
                        </td>
                        <td>
                            Prijs
                        </td>
                        <td>
                            Aantal
                        </td>
                        <td>
                            Korting
                        </td>
                        <td>
                            Totale Prijs
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <%# Eval("TITLE") %>
                        </td>
                        <td>
                            <asp:Label ID="lblPrice" runat="server" Text='<%# Eval("PRICE") %>' />
                        </td>
                        <td>
                            <asp:TextBox OnTextChanged="changeAmount()" ID="txtCount" runat="server"></asp:TextBox>
                            <ajaxToolkit:NumericUpDownExtender ID="NumericUpDownExtender1" runat="server" TargetControlID="txtCount"
                                Width="50" Minimum="1" ServiceDownMethod="" ServiceUpMethod="" />
                        </td>
                        <td>
                            -
                        </td>
                        <td>
                            <asp:Label ID="lblAmount" runat="server" />
                        </td>
                    </tr>
                </table>
            </ItemTemplate>
        </asp:FormView>

        <asp:Button ID="btnBestel" runat="server" CssClass="btn" Text="Bestel" OnClick="btnBestel_Click1" />
        <asp:Button ID="btnReChoose" runat="server" CssClass="btnDelete" Text="Kies een ander boek"
            OnClick="btnRechoose_Click" />
    </asp:Panel>
</asp:Content>

Does anyone know the answer?

Thanks a lot, Vincent

  • 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-15T00:41:31+00:00Added an answer on May 15, 2026 at 12:41 am

    You’re trying to assign a client-side method to the OnTextChanged event, which is a server-side event.

    Also, your javascript is referencing the server id of the label and textbox. The WinForms engine appends characters to this depending where the control is nested. Use <%=myControl.ClientID%> to get around this.

    You need to use some pure Javascript for this:

     window.onload=function(){
         //assign client method to textbox
         document.getElementById('<%=txtCount.ClientID%>').onChange = function(){
            var amount = document.getElementById('<%=txtCount.ClientID%>');
            var total = 10 * amount.value;
    
            document.getElementById('<%=lblPrice.ClientID%>').value = total;
    
         }
      }
    

    Place that on your page instead of your current Javascript and get rid of the OnTextChanged="changeAmount()" attribute.

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

Sidebar

Related Questions

I've been trying to use the AutoComplete Extender from the ASP.NET Ajax Control Toolkit,
I recently installed asp.Net Ajax control toolkit. But in my program files /telerik folder
I've installed ELMAH 1.1 .Net 3.5 x64 in my ASP.NET project and now I'm
I'm planning a new ASP.NET project that will become a product that is installed
I am using AJAX-enable web services in my ASP.NET MVC3 application and I want
How would I use the ASP.NET AJAX Controls in MVC3? e.g. Masked Edit Box
I have a ASP.Net website that is failing on AJAX postbacks (both with ASP.Net
I've just installed ASP.NET MVC on my Vista x64 box, and created a default
I've installed ASP.NET MVC3 and the Tools Update, but don't see any MVC3 controls
I'm supporting a ASP.NET v2.0 app installed on a Windows 2003 SP3 Enterprise on

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.