1
GridView가 있으며 GridView 내에 특정 열에 Linkbutton을 추가합니다. 내 GridView에서 만든 LinkButton을 클릭하면 내 ModalPopupExtender가 표시됩니다. RowDataBound에서 만든Gridview가있는 ModalPopupExtender
하는 LinkButton :
<script language="javascript" type="text/javascript">
function ShowModal() {
var modal = $find('ModalPopupExtender1');
modal.show();
}
</script>
ModalPopupExtender
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="LinkButton1" PopupControlID="Panel1" DropShadow="true"
BackgroundCssClass="modalBackground" CancelControlID="cmdCancel" BehaviorID="ModalPopupExtender1" Drag="true">
</asp:ModalPopupExtender>
내 ModalPopupExtender가하는하는 LinkButton을 클릭 할 때 문제가 무엇 : 내 ModalPopupExtender를 보여주는
Private Sub grdDetails_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles grdDetails.RowDataBound
Try
Try
If Not iColAttachent Is Nothing Then
For Each i In iColAttachent
If e.Row.DataItem(i - 1).ToString.Trim.Length > 0 Then
Dim c As New TableCell
Dim LB As New LinkButton
Dim strBookNo As String = e.Row.DataItem(i - 1).ToString
' Create link
LB.ID = "LB_" & strBookNo
LB.Text = strBookNo.Substring(strBookNo.IndexOf("_") + 1)
LB.ToolTip = "Click to change book number"
LB.Attributes.Add("AutoPostBack", "False")
LB.Attributes.Add("OnClick", "ShowModal()")
'HL.Attributes.Add("runat", "server")
e.Row.Cells().RemoveAt(i)
e.Row.Cells().AddAt(i, c)
c.Controls.Add(LB)
End If
Next
End If
Catch
' nothing to do
End Try
Catch ex As Exception
End Try
End Sub
자바 스크립트 보여 주지만 잠시 후에 다시 사라집니다. 포스트 백 때문인지 확실하지 않습니다.