Click here to Skip to main content
11,932,168 members (63,305 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# Javascript .NET .NET4
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

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 20:04pm
Edited 18-Mar-13 4: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..
Member 9445358 27-Feb-13 9:26am
but when i hover over the linkbutton, the javascript should trigger again, but it doesn't
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

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 | Mobile
Web03 | 2.8.151126.1 | Last Updated 18 Mar 2013
Copyright © CodeProject, 1999-2015
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