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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:48:54+00:00 2026-05-20T17:48:54+00:00

My problem is: after my code call the server and it return with the

  • 0

My problem is: after my code call the server and it return with the alteration that i need, my mask disappear. (this occur only with the mask inside the update panel)

PS: I tryed link my html code with the data, but i was unable to do it.

so just to show the ideia:

<ScriptManager>
    <UpdatePanel>
    <ContentTemplate>
        <Table>
            <asp:TextBox runat="server" ID="txtCnpj" CssClass="cnpj_m" MaxLength="50"/>
        </Table>
    </ContentTemplate>
    </UpdatePanel>
</ScriptManager>

In my code-behind I just hide and show some items. (It’s an ascx control) and my javascript is this:


$(function () {
    $(".data_m").mask("99/99/9999");
    $(".telefone_m").mask("9999-9999");
    $(".dddtelefone_m").mask("(999) 9999-9999");
    $(".ddd_m").mask("(999)");
    $(".cep_m").mask("99999-999");
    $(".cpf_m").mask("999.999.999-99");
    $(".cnpj_m").mask("99.999.999/9999-99");
});

I’m using jQuery 1.5.1.

And the plugin Masked Input Plugin from digitalBush

Anyone has any idea how i can solve this?

PS2: my mask WORKS when i start the page, only stop after i call the server.

EDIT:

this is how i tryed update after load.



$(".rbToggle").live('change',function () {
    //$("#txtCpf").mask("999.999.999-99");
    //$("#txtCnpj").mask("99.999.999/9999-99");
    // Edit, i'm using the code below, i put the top as sample, but i guess it may be kind hard to ppl see this sometimes.
    $("#%= txtCpf.ClientID %>").mask("999.999.999-99");
    $("#%= txtCnpj.ClientID %>").mask("99.999.999/9999-99");
});

EDIT2: i forgot mentioning that without updatepanel, the mask and javascript work is perfect

  • 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-20T17:48:55+00:00Added an answer on May 20, 2026 at 5:48 pm

    You need to activate the masks each time the content is re-rendered. So when the update panel reloads, activate the masks again.

    You can do this through the pageLoaded javascript method, through a RegisterStartupScript, or by placing the activation javascript within the partial view.

    For example:

    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_pageLoaded(function(){
        // global partial postback complete
        // add masks here
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This problem occurred during daylight saving time change. After the change occurred, we've noticed
A coworker of mine has this problem, apparently after installing Re#, which seems totally
This is the code I use to setup my TCP server internal void Initialize(int
After having solved the problem of getting the editor to launch when there's a
I had a problem with committing changes after merging two branches of my project
I had recently a problem with oom-killer starting to kill processes after some time.
After getting fine answer to my previous question , I came across another problem.
Returning to WinForms in VS2008 after a long time.. Tinkering with a OOD problem
I've encountered a problem with my Netbeans 6.1 IDE. After an unsuccessful update, Netbeans
I was recently tasked with debugging a strange problem within an e-commerce application. After

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.