I am having a hell of a time getting this to work correctly. I have a RadWindow that can be launched from any site on the page (the link resides on a master page) and will bring up a login window.
When the user successfully logins in, the SQL reader will set a variable in session and then once the data reader has closed SHOULD redirect to a page based on what is stored in the session variable.
So I need to be able in my code behind to say If Session("ThisValue") = Something then Close RadWindow and redirect parent.
I have this code in the RadWindow:
I just don't know how to call that from my code behind. I am trying it like so:
This does not work. In fact it simply refreshes the radwindow and the controls lose their formatting and styles.
Any help would be greatly appreciated.
When the user successfully logins in, the SQL reader will set a variable in session and then once the data reader has closed SHOULD redirect to a page based on what is stored in the session variable.
So I need to be able in my code behind to say If Session("ThisValue") = Something then Close RadWindow and redirect parent.
I have this code in the RadWindow:
<
script
type
=
"text/javascript"
>
function RedirectUser(sender, args) {
GetRadWindow().BrowserWindow.location.href = '../ThisPageWhenRedirectUser.aspx';
GetRadWindow().close(); //closes the window
}
function GetRadWindow() //Get reference to window
{
var oWindow = null;
if (window.radWindow)
oWindow = window.radWindow;
else if (window.frameElement.radWindow)
oWindow = window.frameElement.radWindow;
return oWindow;
}
</
script
>
I just don't know how to call that from my code behind. I am trying it like so:
'after database has retrieved and stored the value in session
If (Session("UserType") = Something Then CloseRadAndRedirect()
Public Sub CloseRadAndRedirect()
If (Not ClientScript.IsStartupScriptRegistered("GetRadWindow")) Then
ScriptManager.RegisterStartupScript(Page, Me.GetType(), "GetRadWindow", "RedirectUser();", True)
End If
End Sub
This does not work. In fact it simply refreshes the radwindow and the controls lose their formatting and styles.
Any help would be greatly appreciated.