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 3677880
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:16:29+00:00 2026-05-19T03:16:29+00:00

i have a listview with an sqldatasource and the link buttons don’t get fired

  • 0

i have a listview with an sqldatasource and the link buttons don’t get fired up, but if i use as datasource an String array they get fired up. Am i missing something in my code?

aspx page:

    <%
    SqlDataSourceArticoleUser.ConnectionString = conn;
    SqlDataSourceArticoleUser.SelectCommand = "SELECT top 10 * FROM (SELECT ROW_NUMBER() OVER (ORDER BY id desc) AS Row, * FROM articole) AS EMP WHERE Row >" + pag + " and username='" + user + "'";
            %>
<asp:ListView ID="ListViewArticoleUser" runat="server" DataSourceID="SqlDataSourceArticoleUser">
                <LayoutTemplate>
                    <ul>
                        <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
                    </ul>
                </LayoutTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButtonEditArticolEdit" runat="server" Text="edit" CommandName="articoledit"></asp:LinkButton>
                    <asp:LinkButton ID="LinkButtonStergeArticolEdit" runat="server" Text="sterge" CommandName="articolsterge"></asp:LinkButton>
                </ItemTemplate>
</asp:ListView>
<asp:SqlDataSource ID="SqlDataSourceArticoleUser" runat="server"></asp:SqlDataSource>

aspx.cs page:

protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            SqlDataSourceArticoleUser.DataBind();
        }
    }
    protected void Page_Init(object sender, EventArgs e)
    {
        ListViewArticoleUser.ItemCommand += new EventHandler<ListViewCommandEventArgs>(ListViewArticoleUser_EventHandler);
    }
    protected void ListViewArticoleUser_EventHandler(object sender, ListViewCommandEventArgs e)
    {
        if (e.CommandName == "articolsterge")
        {
        }
    }
  • 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-19T03:16:30+00:00Added an answer on May 19, 2026 at 3:16 am

    I think you are missing something… When you use a string array as datasource, you will use the default c# dataadapter, that contains instructions for delete, update and insert.

    When you are working with an sql datasource, you must configure how .net will deal with those operations. I can see you just configured the select operation. To have a full functional sqldatasource, I think you must fill other operations.

    Check this article to help you with your datasource: http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/data/sqldatasource.aspx!

    Specially this part:

    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
      ConnectionString="<%$ ConnectionStrings:Pubs %>"
      SelectCommand="SELECT [au_id], [au_lname], [au_fname], [state] FROM [authors]"
      UpdateCommand="UPDATE [authors] SET [au_id] = @au_id, [au_lname] = @au_lname,[au_fname] = @au_fname, [state] = @state WHERE [au_id] = @original_au_id"
      DeleteCommand="DELETE FROM [authors] WHERE [au_id] = @original_au_id"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQLDataSource that is bound to a ListView control but I want
I have Listview on WinForm I need to have two columns but without headers,
I have got ListView with a custom Adapter. Every row contains clickable buttons and
I have ListView which shows images from an ImageList. Now wanted to get index
I'm defining a datasource (for a sortable listview) and have a minor snag. Code
I have ListView that has the following EditItemTemplate: <EditItemTemplate> <tr style=> <td> <asp:LinkButton ID=UpdateButton
I have a ListView control, and I'm trying to figure out the easiest/best way
I have a ListView which sometimes I need to put around 10000 items in.
I have a ListView in WPF that is databound to a basic table that
I have a ListView containing file names. These file names need to be draggable

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.