CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2001
    Location
    Irvine CA USA
    Posts
    88

    Buttons inside a Repeater

    I have a Linkbutton control inside the template for a Repeater control.

    So far, all i have been able to find out is that you can get the text of the linkbutton through the repeaters ItemCommand method, but all my link buttons have the same text.

    Does anyone have any strategies for putting buttons inside a repeater or datalist?

  2. #2
    Join Date
    Oct 2002
    Location
    Houston
    Posts
    6
    You're question is a little broad. Can you be more specific?
    Mike Huguet
    Senior Consultant
    Software Architects, Inc.
    MCSD, MCDBA, MCSA

  3. #3
    Join Date
    Jun 2001
    Location
    Denmark
    Posts
    453

    Re: Buttons inside a Repeater

    Yeah, well, I see no problem in that. But I suppose, that the ID's (not caption) are not all the same (in which case you ought to change your code)
    I use this in the repeater_ItemCommand()

    Code:
    				System.Web.UI.Control c = ((System.Web.UI.Control)(((System.Web.UI.WebControls.WebControl)(((System.Web.UI.WebControls.LinkButton)(((System.Object)(e.CommandSource))))))));
    				switch (c.ID)
    				{
    					case "LinkBtn_Abonnent":
    						arr1.Sort(new abon_data.Comparer_SAPComp(SAPDefines.SAP_ORDERBY_ABONNENT));
    						break;
    That won't mind the caption being the same on all link buttons :-)

    /Lars

  4. #4
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167

    Re: Buttons inside a Repeater

    Actually you want to utilize the COMMANDNAME property of the LinkButtons to differentiate between them.
    Good Luck,
    -Cool Bizs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured