Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6082331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:16:39+00:00 2026-05-23T11:16:39+00:00

I have been working purely with ASP.NET so far, but am getting frustrated with

  • 0

I have been working purely with ASP.NET so far, but am getting frustrated with the restrictions of the AJAX toolkit when it comes to animations, so I have been looking at using Jquery since yesterday to spice up my UI. Please bear in mind that I am a complete newbie when it comes to Jquery and client-side scripting.

I currently have a Listview which displays paragraphs of a report I am writing, like so:

<div class="projectNotesListOverall">

            <asp:ListView ID="lvProjectNotes" runat="server" DataSourceID="dsProjectNotes" DataKeyNames="Note_ID" OnItemDataBound="lvProjectNotes_ItemDataBound" OnPreRender="lvProjectNotes_PreRender" OnItemCommand="lvProjectNotes_ItemCommand" >

                <ItemTemplate>

                    <div class="projectNotesNoteContainer" >

                        <div class="projectNotesNoteTitleContainer">
                            <div class="projectNotesTitleInfo" >
                                <asp:Label ID="note_OrderLabel" runat="server" Text='<%# Eval("Note_Order") + ". " %>' CssClass="projectNotesNoteTitleLabel" />
                                <asp:Label ID="Note_TitleLabel" runat="server" Text='<%# Eval("Note_Title") %>' CssClass="projectNotesNoteTitleLabel" />
                            </div>

                            <asp:Button ID="btnMoveUp" runat="server" Text="&#x25B2;" ToolTip="Click to move up" CommandName="MoveItemUp" CommandArgument='<%# Eval("Note_Order") %>' CssClass="narrowButtons20" />
                            <asp:Button ID="btnMoveDown" runat="server" Text="&#x25BC;" ToolTip="Click to move down" CommandName="MoveItemDown" CommandArgument='<%# Eval("Note_Order") %>' CssClass="narrowButtons20" />
                            <asp:Button ID="btnEditNote" runat="server" Text="Edit" ToolTip="Click to edit this note" CommandArgument='<%# Eval("Note_ID") %>' onclick="btnEditNote_Click" CssClass="narrowButtons50" />
                        </div>

                        <div>
                            <asp:Label ID="Note_ContentLabel" runat="server" Text='<%# Eval("Note_Content") %>' CssClass="projectNotesNoteContentLabel" />
                        </div>

                    </div>

                </ItemTemplate>

            </asp:ListView>

        </div>

What I would like to do is create an onclick event on the projectNotesTitleInfo div, such that it will toggle the visibility of the Note_ContentLabel label…
I know I can do this server-side in the item databound event, in fact I did it earlier, but somehow it didn’t seem to work properly… That is, in IE, the divs seems to jump after they have been toggled, and in chrome, the first time the toggle is used, the div expands, even though it is already expanded. In the source code in Chrome, any single quotes (‘) which I add in the attributes.add(“onclick”, “”); bit show up as ' and I wonder if that might have something to do with it.

I am using ASP.NET 4, so I thought of using ClientIDMode=”Predictable” and link that to my datakey field, BUT I can’t figure out how to pass this to the onclick event of the div… I tried stuff like onclick='<%# “$(‘Note_ContentLabel_” + Eval(“Note_ID”) + “‘).toggle(”slow)” %>’ and variations of that, but none of them worked…

What is the correct approach to get this to work? In general, what is the right approach to use animations on items in repeating server controls?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:16:39+00:00Added an answer on May 23, 2026 at 11:16 am

    Actually when using jquery, you may not need to attach onclick from server side – for example, in your case, a script such as below should do the trick:

    $(document).ready(function() {
       // get all titles & attach click handler
       $('.projectNotesListOverall .projectNotesTitleInfo').click(function() {
           // find the related note & toggle it
           $(this).parent().parent().find('.projectNotesNoteContentLabel').toggle('slow');
       });
    });
    

    Have this script on your page and it should work. If you still find that toggling jumpy then issue can be related your CSS classes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working with ASP.NET for a few years and am now working
I have been working on a JQuery script that posts JSON to my asp.net
I have been working with Visual Studio (WinForm and ASP.NET applications using mostly C#)
I have been working on asp.net 3.5.I want to Convert a DateTime Data from
I have been working on a project on and off, but I haven't touched
I have been working in C# for quite some time but come around this
I have been working on a new menu and I'm almost there, but the
I have been working on a system which I'm using protobuf-net (version 2.0.0.480) for
I have been working on an app for a couple of months now, but
I have been working on an open source project for awhile, http://gtkworkbook.sourceforge.net/ , and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.