Results 1 to 2 of 2

Thread: [2005] ImageButton in Gridview

  1. #1

    Thread Starter
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Thumbs up [2005] ImageButton in Gridview

    I am adding one image button in the Row Bound event of the Gridview as



    Code:
    ImageButton imgSortAssendingbyId = new ImageButton();
    
    imgSortAssendingbyId.Click += new ImageClickEventHandler(this.imgSortAssendingbyId_Click);
    
     
    
    private void imgSortAssendingbyId_Click(object sender, ImageClickEventArgs e) 
    {
    
    }
    The View source of the page is

    PHP Code:
    input type="image" name="grvResources$ctl01$ctl01title="Sort Ascending" src="wv_sort_asc.gif" style="height:6px;border-width:0px;" /> 
    But the click event is not firing
    I could not able to find the click event ?How to add the runat server property ?

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005] ImageButton in Gridview

    Because the image is inside the Gridview, the event is raised but not as you specify it. You will need to handle the Gridview's RowCommand event. Give your ImageButton a CommandName and CommandArgument so that you can look at these in the GridView's RowCommand event.

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