Click here to Skip to main content
15,912,205 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i just add a Image button in the grid view and converted field as a Template field and then i add Ajax Model pop up extender for image button.thinks works fine up to this point. Butthen need to transfer particular value of a grid view to a Ajax pop up panel's Label. but it did not worked. then i dubug and just notice that the image button_Click event is not firing when i click on the image button.. it is not executing :( hm...anyone have a Solution for that problem.? Is it possible to write the Code in Row Command Event.Since I'm using Template Field i guess i cannot trigger the image button event in row command event?


Code :
XML
<asp:TemplateField HeaderText="  " ShowHeader="False">
   <ItemTemplate>
        <asp:ImageButton ID="IBtnPODinfo" runat="server" Height="16px"
         ImageUrl="~/Resources/images/search-icon.png" onclick="IBtnPODinfo_Click1"
          TabIndex="1" ToolTip="List POD data" Width="25px" />

           <asp:ModalPopupExtender ID="Lbtn_cash_Shipper_ModalPopupExtender" TargetControlID="IBtnPODinfo"
           PopupControlID="Panel5" CancelControlID="panel1Close" runat="server">
           </asp:ModalPopupExtender>

 </ItemTemplate>
</asp:TemplateField>





C# Code :


C#
protected void IBtnPODinfo_Click1(object sender, ImageClickEventArgs e)
       {
           int index = ((GridViewRow)((Control)sender).NamingContainer).RowIndex;

           Lbl_HAWB.Text = ExtractPODGridView.Rows[index].Cells[0].Text;

       }
Posted
Updated 14-Sep-12 21:44pm
v2
Comments
AmitGajjar 15-Sep-12 5:00am    
Are you using UpdatePanel ?
Hesha 15-Sep-12 5:08am    
No..not usedupdate panal
AmitGajjar 15-Sep-12 5:10am    
Clean your solution: remove debug and bin folders and rebuild, try again.
Hesha 15-Sep-12 5:17am    
not working here buddy.. Ajax pop is ok but template Image buttonClick is not working..event is not firing!. i just only need to set a value for a Label in the popup panal.
AmitGajjar 15-Sep-12 5:18am    
add one normal button and try with that

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900