Ajax Update Panel and Jquery


I am stuck with partial page refresh with update panels.
I have a user control which contains a dropdown and a button.
I also have a repeater in the main page and some other controls and the user control.
Based on some click events the repeater or the other controld should refresh.

I am able to attain that with update panels but some styling of the dropdown in the user control goes off in partial page refresh.

There is a update panel in the user control.
The styling of the user control dropdown is done in jquery.
So if i make the document.ready function as function pageLoad() the css retains since the pageLoad is called on all postback whether first time or partial.

But there is a validation function also in the document.ready function and the validation messages prompts more than once based on the number of partial postbacks.

i want to load the document readu function on each postback but want to restrict the validation function which is inside the ready function and wants to load only first time to avoid validation messages prompting more than once.

Also please provide me with how do we do partial page postback with jquery without using ajax.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steve KrileCommented:
Well, your last sentence is a totally different issue - but, I do have a good way to ensure that after an UpdatePanel has finished to execute script:  <cc1:UpdatePanelAnimationExtender />

This is a beautiful addition to UpdatePanels that allow you to tap in to the process of updating and trigger things before and after updating.  For your problem, I would do something like this (abstracted):

<asp:UpdatePanel runat="server" id="UpdatePanel1">

<cc1:UpdatePanelAnimationExtender runat="server" ID="upAni1" TargetControlID="UpdatePanel1">
          <ScriptAction Script="doformatting()" />

<script language="javascript">
    function doformatting(){
      //clean up the formatting of the drop down that was just created

With this setup, you get all the server-side goodness of the UpdatePanel control but are then able to do things after the panel has been updated on the client side.  Best of both worlds if you ask me.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
manishk1111Author Commented:
the multiple validation message is removed by adding the validation function in document.ready function  which loads only one time and the css loading is done on all loads even on partial page upload with the  pageLoad funtion in jquery.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.