Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
i have two DropDowns:

DdlState and DdlCity,

And I Provide Special Design and working to both of them using java script and css,

and After Selection Of state,

the Ddlcity DropDown is bind,
It work fine,


But Now problem is:
i use update panel,
to avoid page refresh( when city bind according to state),

After this city Bind Correctly but My DropDown "Style And Special Working Is Stop Working",

so I thing i need to again call the java script and css, which i put at page Load,
So how can I call these java script at Dropdown Bind,

The Script are:
XML
<script src="ServerJs_and_css/min_1.7.1.js" type="text/javascript"></script>
<script src="DropDownNew_jquery/chosen.jquery.js" type="text/javascript"></script>
<link href="DropDownNew_jquery/chosen.css" rel="stylesheet" type="text/css" />






Problem 2:

i face The same Problem When:

I have a image Slider Which bind Accroding to Dropdown,
And When I use Update Panel And Then Select Dropdown to bind image slider jquery,
Then Data are came Properly but
Image slider Stop Working,

This time Java script are:

<script type="text/javascript">

    function mycarousel_initCallback(carousel) {
        // Disable autoscrolling if the user clicks the prev or next button.
        carousel.buttonNext.bind('click', function () {
            carousel.startAuto(0);
        });

        carousel.buttonPrev.bind('click', function () {
            carousel.startAuto(0);
        });

        // Pause autoscrolling if the user moves with the cursor over the clip.
        carousel.clip.hover(function () {
            carousel.stopAuto();
        }, function () {
            carousel.startAuto();
        });
    };

    jQuery(document).ready(function () {
        jQuery('#mycarousel').jcarousel({
            auto: 2,
            wrap: 'last',
            initCallback: mycarousel_initCallback
        });
    });
   
   
</script>




So plz Help me, What Can i do,

If You have Any Confusion About Question, Then Plz Comment, I Will try to improve it
Posted
Updated 7-Jan-13 2:38am
v2

document.ready() does not work with async postback. You have to re-bind your functionality something like this:
JavaScript
jQuery(document).ready(function () {
jQuery('#mycarousel').jcarousel({
auto: 2,
wrap: 'last',
initCallback: mycarousel_initCallback
});
});

var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(function() {
jQuery('#mycarousel').jcarousel({
auto: 2,
wrap: 'last',
initCallback: mycarousel_initCallback
});
});
 
Share this answer
 
Comments
Arun kumar Gauttam 8-Jan-13 0:15am    
Thanks for Trying But It not work for me
Arun kumar Gauttam 8-Jan-13 0:44am    
i find the solution,in google,
But Thanks,
because i properly understand my problem with the help of you
i find the solution with the help of google:

XML
<script type="text/javascript">
    $(function() {
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
    });

    function EndRequestHandler(sender, args) {
        // code that you want to run when the request is complete
    }
<script>



It Work Fine on async postback post back
 
Share this answer
 
v2
Comments
Zafar Sultan 8-Jan-13 3:22am    
That's exactly the same solution. Good you solved it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900