We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Jquery doen't work with MultiView

ivolach
ivolach asked
on
Medium Priority
1,608 Views
Last Modified: 2012-05-11
Hello,

I have a div inside a MultiView that is inside an UpdatePanel. When I click on the button that is inside UpdatePanel the callback is performed and the div appears, but it doesn't change its color on mouse hover (jquery doesn't work).

If I put the div outside the UpdatePanel jquery works correctly.

What could be the problem here?

Thank you
 
<script src="jquery-1.5.2.min.js" type="text/javascript"></script>
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#MyDiv").hover(function () { $(this).css({ 'background-color': 'Red' }) });
        });     
 
    </script>
    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:MultiView runat="server" ID="mvPopup">
                <asp:View ID="View1" runat="server">
                         <div id="MyDiv"> Some text here</div>
                </asp:View>
            </asp:MultiView>
            <asp:LinkButton runat="server" OnClick="btnLink_Click" ID="btnLink" Text="Click here" />
        </ContentTemplate>
    </asp:UpdatePanel>

     protected void btnLink_Click(object sender, EventArgs e)
        { 
            mvPopup.ActiveViewIndex = 0;
        }

Open in new window

Comment
Watch Question

Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
because problem is solved
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.