Hi all.
I am having trouble getting a ModalPopupExten der to display with the corresponding data. This will be triggered by clicking on a "Details" button in a gridview. Eg. by clicking on Row1 details button, ModalPopup will display Row1 information
I suspect this might be due to the following section:
ModalPopupExten der Code:
There is a warning stating Possible NullReferenceEx ception at line grdBookings.Dat aKeys[e.Row.RowIndex]. I have not stated the DataSource in the gridview itself as Im not sure how to do so since Im using a custom Stored Procedure. Could this be a cause?
I hope those in the know could help me as much as possible, thank you.
I am having trouble getting a ModalPopupExten der to display with the corresponding data. This will be triggered by clicking on a "Details" button in a gridview. Eg. by clicking on Row1 details button, ModalPopup will display Row1 information
I suspect this might be due to the following section:
Code:
protected void grdBookings_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Button Details1 = (Button)e.Row.FindControl("details1"); Details1.Attributes.Add("onclick", "return ShowMyModalPopup('" + grdBookings.DataKeys[e.Row.RowIndex].Values + "')"); } }
Code:
<asp:ModalPopupExtender ID="ModalPopupExtender1" BehaviorID="ModalPopupExtender1Behaviour" runat="server" PopupControlID="Panel1" TargetControlID="details1" BackgroundCssClass="modalBackground" OnCancelScript="HideModalPopup()" CancelControlID="Close"></asp:ModalPopupExtender>
I hope those in the know could help me as much as possible, thank you.