there are several tabstrip in my aspx page, when use click on the tab, it will redirect to another aspx.
example
Parent.aspx
- RabTab1 (page1.aspx)
- RabTab2 (page2.aspx)
how can i close the whole window (parent.aspx) when user already click RadTab2 and enter into (page2.aspx) ?
Code behind:
example
Parent.aspx
- RabTab1 (page1.aspx)
- RabTab2 (page2.aspx)
how can i close the whole window (parent.aspx) when user already click RadTab2 and enter into (page2.aspx) ?
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
>Position Details</
title
>
<
script
type
=
"text/javascript"
>
function UpdateRefresh() {
if (window.opener)
window.opener.UpdateRefresh();
}
</
script
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
telerik:RadSplitter
ID
=
"RadSplitter1"
runat
=
"server"
Width
=
"100%"
Height
=
"100%"
Orientation
=
"Horizontal"
>
<
telerik:RadPane
ID
=
"rpTitle"
runat
=
"server"
BackColor
=
"#003399"
Height
=
"27px"
MinHeight
=
"27"
MaxHeight
=
"27"
Width
=
"100%"
Scrolling
=
None
>
<
asp:Table
ID
=
"Table1"
runat
=
"server"
Width
=
"100%"
Height
=
"100%"
>
<
asp:TableRow
>
<
asp:TableCell
Width
=
"33%"
>
<
asp:Label
ID
=
"lblPositionCode"
runat
=
"server"
Text
=
""
ForeColor
=
"White"
Font-Size
=
"12pt"
Font-Bold
=
"true"
></
asp:Label
>
</
asp:TableCell
>
<
asp:TableCell
Width
=
"33%"
HorizontalAlign
=
"Center"
>
<
asp:Label
ID
=
"lblPositionName"
runat
=
"server"
Text
=
""
ForeColor
=
"White"
Font-Size
=
"12pt"
Font-Bold
=
"true"
></
asp:Label
></
asp:TableCell
>
<
asp:TableCell
Width
=
"34%"
HorizontalAlign
=
"Right"
>
<
asp:Label
ID
=
"lblDepartment"
runat
=
"server"
Text
=
""
ForeColor
=
"#FFCC00"
Font-Size
=
"12pt"
Font-Bold
=
"true"
></
asp:Label
>
</
asp:TableCell
>
</
asp:TableRow
>
</
asp:Table
>
</
telerik:RadPane
>
<
telerik:RadPane
ID
=
"rpTab"
runat
=
"server"
Height
=
"26px"
MinHeight
=
"26"
MaxHeight
=
"26"
Width
=
"100%"
>
<
telerik:RadTabStrip
ID
=
"rtMenu"
runat
=
"server"
Skin
=
"Outlook"
SelectedIndex
=
"0"
>
<
Tabs
>
<
telerik:RadTab
Text
=
"History"
Value
=
"History"
Selected
=
"True"
Width
=
"100px"
></
telerik:RadTab
>
<
telerik:RadTab
Text
=
"Details"
Value
=
"Details"
Width
=
"100px"
></
telerik:RadTab
>
<
telerik:RadTab
Text
=
"Compliance"
Value
=
"Compliance"
Width
=
"100px"
></
telerik:RadTab
>
<
telerik:RadTab
Text
=
"Competency"
Value
=
"Competency"
Width
=
"100px"
></
telerik:RadTab
>
<
telerik:RadTab
Text
=
"Procedure"
Value
=
"Procedure"
Width
=
"100px"
></
telerik:RadTab
>
<
telerik:RadTab
Text
=
"Succession"
Value
=
"Succession"
Width
=
"100px"
></
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
</
telerik:RadPane
>
<
telerik:RadPane
ID
=
"rpContent"
runat
=
"server"
>
</
telerik:RadPane
>
</
telerik:RadSplitter
>
</
form
>
</
body
>
</
html
>
Code behind:
Protected Sub rtMenu_TabClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTabStripEventArgs) Handles rtMenu.TabClick
If e.Tab.Value = "History" Then
rpContent.ContentUrl = "PositionHistory.aspx?PosID=" & Request("PosID")
ElseIf e.Tab.Value = "Details" Then
rpContent.ContentUrl = "PositionInfo.aspx?PosID=" & Request("PosID")
ElseIf e.Tab.Value = "Succession" Then
rpContent.ContentUrl = "SuccessionPlanning.aspx?PosID=" & Request("PosID")
ElseIf e.Tab.Value = "Compliance" Then
rpContent.ContentUrl = "Compliance.aspx?PosID=" & Request("PosID")
ElseIf e.Tab.Value = "Competency" Then
rpContent.ContentUrl = "Competency.aspx?PosID=" & Request("PosID")
ElseIf e.Tab.Value = "Procedure" Then
rpContent.ContentUrl = "Procedure.aspx?PosID=" & Request("PosID")
End If
End Sub
i had tried to add the following function in child page code behind, but none of them work
'auto close browser
Response.Write("<
script
type
=
'text/javascript'
> " & "window.opener = 'Self';" & "window.open('','_parent','');" & "window.close(); " & "</
script
>")
Me.ClientScript.RegisterClientScriptBlock(Me.[GetType](), "Close", "window.close()", True)
Page.ClientScript.RegisterOnSubmitStatement(GetType(Page), "closePage", "window.onunload = CloseWindow();")
Response.Write("<
script
type
=
'text/javascript'
> " & "window.opener = 'Self';" & "window.open('','_parent','');" & "window.close(); " & "</
script
>")
Page.ClientScriptManager.RegisterClientScriptBlock(Me.[GetType](), "RedirectScript", "window.parent.location = '../Images/Logo_Done.jpg'", True)
Page.ClientScript.RegisterStartupScript([GetType](), "Load", "<
script
type
=
'text/javascript'
>window.parent.location.href = '../Images/Logo_Done.jpg'; </
script
>")