Click here to Skip to main content
15,885,109 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I wrote code that works correctly for a single page, when a linkbutton is hovered over it causes javascript code to execute from a document ready, that causes a popup to show.
BUT when another linkbutton is clicked, causing a postback and then a C#linkbutton_click function to execute, the javascript functions no longer triggers!

<script type="text/javascript">
  $(document).ready(function (e) {....
     $('.cssclassname').hover(function (e) {
       call webservice here
       cause popup to show
     )};
});
</script>

in C# codebehind:
pageload()[
...set display of page and add original set of LinkButtons(added programatically)
}
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
           //get Calenday Month and year and set Calendar title with month and year

            //add new set of linkbuttons to page that should cause popups when hovered over
                (built programatically)

            //set popup data for balloon and picture

        }


when the linkbutton is hovered over, you can see the javascript function call displayed in
the lower left corner of the browser, but no popup or actual execution of javascript occurs
after LinkButton1_Click has executed!

how can this be fixed or how can i troubleshoot?

NOTE: using
JavaScript
var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_pageLoaded(PageLoadedEventHandler);
    function PageLoadedEventHandler() {<pre><pre lang="c#">

INSTEAD of document ready, the javascript now 'fires', but ajax still doesn't call
web service!
Posted
Updated 18-Mar-13 3:32am
v2
Comments
vinodkumarnie 27-Feb-13 1:11am    
When you click linkbutton postback is happens. So javascript will reset to initial values. because of this your popup is not showing. you should prevent postback to see popup on linkbutton click..
Member 9445358 27-Feb-13 9:26am    
but when i hover over the linkbutton, the javascript should trigger again, but it doesn't
Career Web Helper 27-Feb-13 1:43am    
you should call js function on .cs file and write function properly like return true/falsec kind of things

1 solution

Code which you pasted haveing syntax issue.
$(document).ready(function (e) {
$('.cssclassname').hover(function (e) {
alert('here');-- your code is here
});
});

I tried to copy method on my page and it give syntax error may you facing issue due to that only or many be web service have some issue.
 
Share this answer
 

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