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

  • Home
  • SEARCH
  • 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 1113573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:52:44+00:00 2026-05-17T02:52:44+00:00

I am using a ASP .NET ListView with a MS SQL Database. I use

  • 0

I am using a ASP .NET ListView with a MS SQL Database. I use the ListView to show the information and in the list view, there is an hyperlink which opens the editing window for the specific record in a jQuery Modal Dialog Box.

<asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1">

    <LayoutTemplate>
    <div id="itemPlaceholder" runat="server"> </div>
    </LayoutTemplate>
    <ItemTemplate>
    <!--More Items -->
    <a name="Link" href="EditItem.aspx?id=<%# Eval("articleid")%>">Edit</a> 
    <!--More Items -->     
    </ItemTemplate>

    </asp:ListView>
    </div>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:myConnectionString %>" 
        SelectCommand="SQL-SELECT-STATEMENT">
    </asp:SqlDataSource>

    <div>

And jQuery works by taking the link of each item which has the name “Link” and associating it with a dialog box.

<script type="text/javascript">


    $(document).ready(function() {
    $("a[name=Link]").each(function() {    


            var $link = $(this);
            var $dialog = $('<div></div>')
                .load($link.attr('href'))
                .dialog({
                    autoOpen: false,
                    title: "Edit Article",
                    width: 500,
                    height: 550
                });

            $link.click(function() {
                $dialog.dialog('open');

                return false;
            });
        });
    });
</script>

Everything worked as it should. Earlier all the records could be shown in one go but as the number of records grew, I needed a paging solution. DataPager for the rescue!

<asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" PageSize="5">
    <Fields>
    <asp:NextPreviousPagerField />
    <asp:NumericPagerField />
    </Fields>
</asp:DataPager>

But now the DataPager’s controls are not working! I cannot go back,forward or click a page number as it will open the first data bound item’s href in the ListView without a dialog box (Just like a normal page). But if i remove the jQuery code, the paging works as it should but I don’t get the neat modal dialog box for my editing 🙁

Any ideas why these cannot exist with each other? Thanx a lot in advance 🙂

UPDATE: What doesn’t work is that they cannot co-exist peacefully. If i remove the jQuery code, the DataPager works fine but I will lost my modal dialog box for editing. If i put the jQuery code back, the modal dialog box works fine but the DataPager doesn’t 🙁

  • 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-17T02:52:45+00:00Added an answer on May 17, 2026 at 2:52 am

    My guess is that link selector is probably selecting data pager links.
    You can try $("a[name='Link']").each(.. note single quotes around attribute value.

    Alternately, why don’t you use id or class selectors. For example:

    <a id="editLink" ...
    

    and

       $('a#editLink;).each(...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the new ASP.Net ListView control to list database items that will be
I'm using the ListView control (ASP.NET 2008) to show a bunch of lines of
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using ASP.net 2.0, how do I present the information to the user similar to
Using asp.net MVC I'd like to do this inside a view: <%= Html.TextBox(textbox1, null,
I'm using ASP.NET MVC Preview 4 and would like to know how to use
Using asp.net, I need to generate a snapshot of an youtube video. I have
Using ASP.net, how do you write ANSI characters to a text file? I need
I am using ASP.NET Dynamic Data for a project and I have a table
I have been using ASP.NET for years, but I can never remember when using

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.