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 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

Using ASP.Net, VB.Net When i close or exit the page, it should show the
Using ASP.NET MVC's default view engine, you can declare a server-side comment like this:
So I'm using ASP.NET with C#. And I have an item that is queried
using asp.net 3.5 I am trying to generate a formatted excel spreadsheet and the
Using ASP.Net, VB.Net In my web page, i have the textbox values when i
Using ASP.Net, VB.Net In my web page, i want to attach the file. How
Using ASP.NET 2.0, with forms authentication. Just for a test, I configured the roles
Using asp.net mvc 2 c#. I have a dynamic form. I want to get
Im using asp.net mvc 2. I have a model Supermodel that consists of 2
How do I model the following using Castle ActiveRecord? I have two classes, Customer

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.