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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:41:38+00:00 2026-06-13T03:41:38+00:00

I have an interesting ASP/VB.NET problem. I have a gridview where each row has

  • 0

I have an interesting ASP/VB.NET problem. I have a gridview where each row has its own datalist in a template column. I want to add to each item in the datalist a linkbutton that will trigger an event based on data in the datalist. But I’m not sure how to do it. It’s in a project so it has the designer file which does list the gridview but not the datalist inside the gridview. When I try to add it, the listing for the datalist is removed later on when I compile.

My question is now do I get the linkbutton in the datalist in the gridview to do something?

<asp:GridView ID="gvCmteNom" runat="server" AutoGenerateColumns="False" showheader="true" HeaderStyle-BackColor="Silver" Width="1600px">
<Columns>
<asp:TemplateField HeaderText="CURRENT SERVICE">
        <ItemTemplate>
            <asp:TextBox ID="txtID" runat="server" Text='<%# Bind("NOMINEE_ID") %>' Visible="False" Width="25px" />
            <asp:DataList ID="dlCurrentCmtes" runat="server" DataSourceID="dsCurrentCmte" RepeatLayout="Flow" DataKeyField="ID" RepeatDirection="Horizontal">
                <ItemTemplate>
                    <asp:HiddenField runat="server" ID="hdnUserID" Value='<%# Eval("ID") %>' />
                    <asp:Label ID="lblDescription" runat="server" Text='<%# Eval("Description") %>' />
                    <asp:LinkButton runat="server" ID="lbIncrementYear" CommandName="IncrementYear" CommandArgument='<%# Eval("ProductID") %>' Text="Add Year" />
                </ItemTemplate>
                <SeparatorTemplate><br /><br /></SeparatorTemplate>
            </asp:DataList>
            <asp:SqlDataSource ID="dsCurrentCmte" runat="server" 
                ConnectionString="" 
                ProviderName="System.Data.SqlClient" SelectCommand="spCmteList" SelectCommandType="StoredProcedure">
                <SelectParameters>
                    <asp:ControlParameter ControlID="txtID" Name="ID" PropertyName="Text" Type="String" DefaultValue="" />
                </SelectParameters>
            </asp:SqlDataSource>
        </ItemTemplate>
    </asp:TemplateField>
</Columns>

  • 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-06-13T03:41:41+00:00Added an answer on June 13, 2026 at 3:41 am

    Two options:

    Option 1
    Specify the ItemCommand event handler for the DataList and use that to respond to the event:

    <asp:DataList OnItemCommand="Item_Command" />

    Then specify that function in the code behind:

    Sub Item_Command(sender As Object, e As DataListCommandEventArgs) 
         If e.CommandName = "IncrementYear" Then
             ...
         End If
    End Sub
    

    Option 2 Specify the OnClick eventhandler for the link button

    <asp:LinkButton OnClick="LinkButton_Click" runat="server"/>

    Then

    Sub LinkButton_Click(sender As Object, e As EventArgs) 
          ...
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an interesting problem when using partial page update in asp.net with scriptmanager
Well, this is an interesting problem. I have an ASP.NET MVC3 Intranet application running
I came across an interesting problem recently. In an ASP.NET Master Page, I have
I am using ASP .NET MVC 3 and I have an interesting problem to
Interesting one here. I have an ASP.NET 1.1 project that contains a web service
I've an interesting problem with some routing with an ASP.NET MVC app. I'm building
This one will be interesting... I have seen many asp.net thumbnail generation tutorials /
I've been running some experiments with ASP.NET MVC2 and have run into an interesting
This is an interesting problem... I've got an ASP.NET 3.5 web application. It's relatively
I have confusion about GridView in ASP.NET. How does the GridView exactly work? I

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.