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 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

I got the problem that the if-statement doesn't work. After the first code line
I'm working on some existing code. After a few hours, I've boiled this problem
I'm now making unit-tests for already existing code. I faced the next problem: After
My problem is MSVS 2010 C++ compiler is generating code in a way after
It is Hallowe'en after all. Here's the problem: I'm maintaining some old-ish J2EE code,
I got this problem after deploying my web package to IIS: HTTP Error 500.19
Knowing an RPC call to a server method that returns unit is a message
This is the code I use to setup my TCP server internal void Initialize(int
Weird problem: After rotating my app to portrait, picking the toolbar item and exposing
I encountered a problem after having more than one texture in my engine. My

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.