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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:30:02+00:00 2026-05-23T17:30:02+00:00

The DataList: <asp:DataList ID=DataList2 runat=server DataSourceID=AllQuestionsResponded GridLines=Horizontal DataKeyField=ThreadsID onselectedindexchanged=DataList2_SelectedIndexChanged> <ItemTemplate> <asp:LinkButton ID=LinkButton1 runat=server>'<%# Eval(ThreadTitle)

  • 0

The DataList:

  <asp:DataList ID="DataList2" runat="server" 
                    DataSourceID="AllQuestionsResponded" 
                    GridLines="Horizontal" DataKeyField="ThreadsID" 
                    onselectedindexchanged="DataList2_SelectedIndexChanged">
                    <ItemTemplate>

                         <asp:LinkButton ID="LinkButton1" runat="server">'<%# Eval("ThreadTitle") %>'</asp:LinkButton>
                        <br />
                        <br />
                    </ItemTemplate>
                </asp:DataList>

And the sql dataSource:

           <asp:SqlDataSource ID="AllQuestionsResponded" runat="server" 
                ConnectionString="<%$ ConnectionStrings:CP_AllQuestionsAnswered %>" SelectCommand="SELECT ThreadTitle, ThreadsID
FROM Threads 
WHERE ThreadsID IN (SELECT ThreadsID
FROM Comments
WHERE UsersID=@UserID)
" onselecting="AllQuestionAskedDataSource_Selecting">

The code behind event:

    protected void DataList2_SelectedIndexChanged(object sender, EventArgs e)
{
    Server.Transfer("AnswerQuestion.aspx?x=" + DataList2.DataKeyField + "&question=" + DataList2.SelectedValue + "&time=" + DateTime.Now);
}

The event never gets triggered!! no matter how many times I press the button link.. Why is that 🙁 ..

  • 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-23T17:30:02+00:00Added an answer on May 23, 2026 at 5:30 pm

    Try specifying CommandName for selection.

    <asp:LinkButton ID="LinkButton1" CommandName="Select" runat="server">'<%# Eval("ThreadTitle") %>'</asp:LinkButton>
    

    Alternatively, you could use a ButtonColumn

    <asp:BoundColumn    ButtonType="LinkButton"
                        HeaderText="ColumnHeader" 
                        DataField="LinkButton"
                        CommandName="Select" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DataList like so: <asp:DataList ID=dlMyList runat=server RepeatColumns=5 RepeatDirection=Horizontal CellSpacing=5 > <ItemTemplate>
This is my datalist: <asp:DataList ID=DataList1 runat=server DataSourceID=SqlDataSource1 RepeatLayout=Flow> <ItemTemplate> <asp:Label ID=IdLabel runat=server Text='<%#
This my data list: <asp:DataList ID=DataList1 runat=server DataSourceID=SqlDataSource1 RepeatLayout=Flow> <ItemTemplate> Titre: <asp:Label ID=TitreLabel runat=server
In my .aspx page I have my DataList: <asp:DataList ID=DataList1 runat=server DataKeyField=ProductSID DataSourceID=SqlDataSource1 onitemcreated=DataList1_ItemCreated
I have the following itemTemplate in my datalist <ItemTemplate> <asp:LinkButton ID=LinkButton1 CommandName=Select autopostback=True runat=server>'<%#
Possible Duplicate: Understanding asp.net Eval() and Bind() <asp:DataList ID=DataList1 runat=server DataKeyField=CustomerID DataSourceID=SqlDataSource1> <ItemTemplate> CustomerID:
I have a datalist control <asp:DataList ID=DataList1 runat=server DataKeyField=AdmissionNo OnCancelCommand=DataList1_CancelCommand1 OnEditCommand=DataList1_EditCommand1 OnUpdateCommand=DataList1_UpdateCommand1 Width=300px> <ItemTemplate>
i have a datalist control <ItemTemplate> <asp:Label ID=lblAddressID runat=server Text='<%# Bind(StudentName) %>'/> <asp:Label ID=lbl
I have a DataList like below: <asp:DataList runat=server ID=myDataList> <ItemTemplate> <uc:MyControl ID=id1 runat=server PublicProperty='<%#
This is my bare DataList definition :- <asp:DataList runat=server ID=dtltrial ondeletecommand=dtltrial_DeleteCommand DataKeyField=PhotoId > </asp:DataList>

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.