Critical Developers

Programmers Knowledge Base

Refresh Parent Window from Child Window (i.e. popup window)

Refresh Parent Window from Child Window (i.e. popup window)

Put below script in <head>...</head> section

<script language="JavaScript">
<!--
function refreshParent() {
  window.opener.location.href = window.opener.location.href;

  if (window.opener.progressWindow)
       
 {
    window.opener.progressWindow.close()
  }
  window.close();
}
//-->
</script>


THEN ON POPUP/CHILD WINDOW

onclick event of button call javascript:refreshParent();

FOR ASP.NET CODE BEHIND CALL LIKE BELOW:-

Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSubmit.Click
    'your programming logic
ScriptManager.RegisterStartupScript(Me.Page, Me.GetType, "refresh", "javascript:refreshParent();", True)
    'your programming logic
End Sub

Thats It :-)

Separator in Gridview

On Gridview RowDataBound Event put below code:-
Eg:. Code below separate Gridview after every 4th row

'Separator after every 4th row
        Dim i As Integer = 4
        For i = 4 To Gridview1.Rows.Count
            If e.Row.RowIndex = i Then
                For Each cell As TableCell In e.Row.Cells
                    cell.Attributes.Add("Style", "border-top: #000000 1px dotted")
                Next
            End If
            i += 3
        Next
 'Separator end