Click here to Skip to main content
13,138,791 members (55,500 online)
Rate this:
Please Sign up or sign in to vote.
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
in C# codebehind:
...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
var prm = Sys.WebForms.PageRequestManager.getInstance();
    function PageLoadedEventHandler() {<pre><pre lang="c#">

INSTEAD of document ready, the javascript now 'fires', but ajax still doesn't call
web service!
Posted 26-Feb-13 19:04pm
Updated 18-Mar-13 3:32am
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..
RockingDev 27-Feb-13 1:43am
you should call js function on .cs file and write function properly like return true/falsec kind of things
Member 9445358 27-Feb-13 9:26am
but when i hover over the linkbutton, the javascript should trigger again, but it doesn't

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170915.1 | Last Updated 18 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100