hi
i just want to find the control by id of the model popup extender.but method i used always returned a Null value.actually popup extender is located at the one of grid view's Template fields as follows!
<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_dummy"
PopupControlID="Panel5" CancelControlID="panel1Close" runat="server">
</asp:ModalPopupExtender>
</ItemTemplate>
</asp:TemplateField>
'IBtnPODinfo_dummy' is the dummy control for ajaxpopupextender.// i set it because otherwise perticular grid imagebutton(IBtnPODinfo)'s click event is not firing and by setting it to dummy control allows gridbutton to fire.(then i set extender to pop up manually as follows.)
i have imported Ajax tool kit as a reference.
protected void IBtnPODinfo1_Click(object sender, ImageClickEventArgs e)
{
Lbl_HAWB.Text = "TEST_125_ok";
GridViewRow row = ExtractPODGridView.SelectedRow;
if (row == null) return;
ModalPopupExtender extender = new ModalPopupExtender();
extender = row.FindControl("Lbtn_cash_Shipper_ModalPopupExtender") as ModalPopupExtender;
if (extender != null)
{
Panel5.Visible = true;
extender.Show();
}
}
and its returns NULL value.So can someone help me on this matter?
P.S: i set modelpopup extender to a dummy one because otherwise Image button Template of the grid view is not fired!(postback is not occurred) and set manually ajax popup to show in the Imagebtn Click event.and tried. then i realized that the gridviews selected row is returning NULL value.Then i add select command to a gridview and just Select the Gridview by Itself and then i clicked on the Imagebutton and then it get the row and recognized the modelpopup and worked.but it is not i wanted.i want users to click on that imagebtn and get the model pop up with that perticular gridview passing value( gridview should pass one of its cell value to popup panel.)passing value to the panal is ok.I did this because "this.findControl" method was not worked
Code:
extender = this.FindControl("Lbtn_cash_Shipper_ModalPopupExtender") as ModalPopupExtender;
Requirement : what i need is to transfer Gridview's particular cell value (does not need to select the row but to pass relevant row's cell value of the image button ) to popup extender Label and then show the pop up to the users.
E.X : gridview1.SelectedRow.cells[2].value; or gridview1.Rows[i].cells[2].value ect.
Thanks in Advance !!!