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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:19:03+00:00 2026-05-23T21:19:03+00:00

I have a DataList and inside of each item there is an ImageButton that

  • 0

I have a DataList and inside of each item there is an ImageButton that needs to save the contents of an associated textarea. I normally would pass parameters using the CommandArgument tag, but the text inside the description is very long and I do not want to write it out into the commandargument for all the items being displayed. Instead, how can I find the ID of the associated textarea so I can save the text the user changes/enters?

I tried passing ‘this’ into the commandargument but I do not think it is working as it just passes the object for the button and not the whole item.

I realize this seems like a basic question but I’ve searched for over an hour. Your help is very appreciated.

<asp:ImageButton ID="saveDesc" runat="server" AlternateText="Save Image Description" BorderStyle="None" ImageUrl="..\..\images\save.png" CommandArgument='this' CommandName="SaveDescription"  />
<asp:TextBox ID="description" runat="server" Text='<%#Eval("description")%>' style="font-weight:bold; width:100%" TextMode="MultiLine" Height="50px"/>

There are actually multiple DataLists inside of multiple Accordion views, but I’m not sure if this is relevant to the answer.

Thanks

  • 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-23T21:19:03+00:00Added an answer on May 23, 2026 at 9:19 pm

    You can do like…

    protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
    {
     if (e.CommandName == "SaveDescription")
        {
        DataListItem item = ((DataListItem)((ImageButton)e.CommandSource).NamingContainer);
        TextBox description = (TextBox)item.FindControl("description");
        description.Text // return your text 
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a datalist that contains a gridview inside its itemtemplate. on the item-data_bound
I have a datalist inside a usercontrol that gets loaded into a page where
I have a DataList on my webpage that is populated by ItemTemplate . Each
I have a datalist inside that I am using a checkbox, I have 1
I have Datalist that is inside an updatepanel and it is in panel in
I have a DataList inside a DataList that causes my page to lose the
I have a DataList that Displays some Posts with a RadioButtonList inside where it
I have a datalist being generated with ASP, but unfortunately the jQuery script that
Kinda hard to explain, but i'll try. I have a datalist that is populated
Inside my accordion content i have rows of data that are loaded by ajax

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.