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

  • Home
  • SEARCH
  • 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 8528459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:48:22+00:00 2026-06-11T08:48:22+00:00

I creating an ASP.net online application with C# background. I am also using AJAX

  • 0

I creating an ASP.net online application with C# background. I am also using AJAX MaskEditExtender. I’m pretty new to AJAX and don’t know Javascript. What I need to do is have the textbox AJAX mask change based on the selection of the radio buttons.
In this example they are choosing salary or hourly. I need the salary to be “999,999” and the hourly to be “99.99”.

<asp:TextBox ID="finalwage" runat="server" Width="80px">$</asp:TextBox>
<!-- Salary Mask -->
    <asp:MaskedEditExtender 
            ID="MaskedEditExtender1" 
            runat="server" 
            TargetControlID="finalwage" 
            Mask="999,999" 
            MessageValidatorTip="true" 
            MaskType="Number" 
            InputDirection="RightToLeft" 
            AcceptNegative="None" 
            ErrorTooltipEnabled="true">
    </asp:MaskedEditExtender>
    <asp:MaskedEditValidator 
            ID="MaskedEditValidator1" 
            runat="server" 
            ControlExtender="MaskedEditExtender1" 
            IsValidEmpty="true" 
            MinimumValue="0" 
            MaximumValueMessage="Must enter a number" 
            ControlToValidate="finalwage" >
    </asp:MaskedEditValidator>
    <!-- Hourly Mask -->
    <asp:MaskedEditExtender 
            ID="MaskedEditExtender2" 
            runat="server" 
            TargetControlID="finalwage" 
            Mask="99.99" 
            MessageValidatorTip="true" 
            MaskType="Number" 
            InputDirection="RightToLeft" 
            AcceptNegative="None" 
            ErrorTooltipEnabled="true">
    </asp:MaskedEditExtender>
    <asp:MaskedEditValidator 
            ID="MaskedEditValidator2" 
            runat="server" 
            ControlExtender="MaskedEditExtender1" 
            IsValidEmpty="true" 
            MinimumValue="0" 
            MaximumValueMessage="Must enter a number" 
            ControlToValidate="finalwage" >
    </asp:MaskedEditValidator>

…….

<asp:RadioButtonList 
        ID="RadioButtonList1" 
        runat="server" 
        AutoPostBack="true" 
        RepeatDirection="Horizontal" 
        OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged">
    <asp:ListItem Text="Hourly" Value="Hourly"
    <asp:ListItem Text="Salary" Value="Salary" />
</asp:RadioButtonList>

Heres the C# code that I thought would work:

protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
{
    if (RadioButtonList1.SelectedValue = "Hourly")
    {
        MaskedEditExtender1.Mask = "99.99";
    }
    if (RadioButtonList1.SelectedValue == "Salary")
    {
        MaskedEditExtender1.Mask = "999,999";
    }
}
  • 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-11T08:48:23+00:00Added an answer on June 11, 2026 at 8:48 am

    Try to move the RadioButtonList1_SelectedIndexChanged code to Page_Init. I believe RadioButtonList1_SelectedIndexChanged is too late in the lifecycle process to change the mask.

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

Sidebar

Related Questions

Background I am creating an ASP.net application which uses a custom library (not yet
I'm new to Asp.net, and creating a online telephone bill payment form. A new
I'm creating an ASP.NET MVC application using F# on IIS 7. When I attempt
I am creating timed online test in C# asp.net. I have created it using
I am creating a ASP.NET application that is pretty much self contained, it will
I would like to build a new web application using ASP.NET MVC3 and MongoDB.
I'm creating a system using ASP.NET MVC for filling out online job applications. It's
I am creating a Web Application using ASP.NET MVC 3 and I would like
I want to know what is the best solution for creating ASP.NET HTTP Handler
I am creating a asp.net mvc application and loaded the data into jqgrid and

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.