Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. DataList ItemCommand Event Not wortking !! Please help Guys :((

DataList ItemCommand Event Not wortking !! Please help Guys :((

Scheduled Pinned Locked Moved ASP.NET
helpsysadminquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Cape Town Developer
    wrote on last edited by
    #1

    Hi im having an issue with the DataList control not firing the ItemCommand event. here is my code : Snippet 1 (attempt : 1 does not work :( ) <asp:Literal ID="litSortBy" runat="server" Text="<%$ Resources:language_resource, sort_by %>" />: <asp:ListView ID="lvSort" runat="server" OnItemDataBound="lvSort_ItemDataBound" OnItemCommand="lvSort_ItemCommand" > <LayoutTemplate> <asp:PlaceHolder ID="itemPlaceHolder" runat="server" /> </LayoutTemplate> <ItemTemplate> <asp:LinkButton ID="lbtnSort" runat="server" /> <asp:Literal ID="litSpacer" runat="server" Text=" | " /> </ItemTemplate> </asp:ListView> Snippet 2 (attempt : 2 does not work :( ) // Manually registering the events in the codebehind still dont solve anything DataList.ItemCommand +=new EventHandler<ListViewCommandEventArgs>(lvSort_ItemCommand); // Here is the codebeind: protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { BindDataListNavigationProducts(); GetNavigationInfo(); BindSortingOptions(); } } protected void lvSort_ItemCommand(object sender, ListViewCommandEventArgs e) { // Never ever gets here, why what going on here ????? } Can someone please offer an alternavtive solution or a work around this ? Thank you very much in advance. :-)

    Wisdom is often meant as the ability and desire to make choices that can gain approval in a long-term examination by many people.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups