This is a migrated thread and some comments may be shown as answers.

How to use Window as a splash screen?

2 Answers 124 Views
Window
This is a migrated thread and some comments may be shown as answers.
Hassan Yasir
Top achievements
Rank 1
Hassan Yasir asked on 05 May 2010, 12:51 PM
Here is my window.   
<telerik:RadWindow ID="Win1" VisibleOnPageLoad="true" runat="server"
        VisibleStatusbar="false"
        Animation="Fade" ShowContentDuringLoad="false" VisibleTitlebar="false" Behaviors="None" Modal="false">
<contentTemplate>
<img src="myimage.jpeg" />
<a href="#" onClick="myclosefunction();">Close</a>
</contentTemplate>
    </telerik:RadWindow>

Above I have shown a sample of creating a splash window which should be shown when the page is load. I have removed all the skins embedded with it.

I have used ' VisibleOnPageLoad="true" ' to show it on the page load.
Well up to this, it is okay.,

My problem is I don't have any idea to close this window.  I am using an hyperlink which has a close funtion. I don't know what to write on the onClick function.

Could any one give me an exact example to do this? I want to change entire window to show it like a splash screen.

Thanks

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 05 May 2010, 02:23 PM

Hello Hasan,

Try the following approach in order to achieve the functionality.

ASPX:

 
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">  
    <Windows>  
        <telerik:RadWindow ID="Win1" VisibleOnPageLoad="true" runat="server" VisibleStatusbar="false"  
            Animation="Fade" ShowContentDuringLoad="false" VisibleTitlebar="false" Behaviors="None"  
            Modal="false">  
            <ContentTemplate>  
                <img src="../Images/Refresh.gif" />  
                <href="#" onclick="myclosefunction();">Close</a>  
            </ContentTemplate>  
        </telerik:RadWindow>  
    </Windows>  
</telerik:RadWindowManager> 

JavaScript:

 
<script type="text/javascript">  
    function myclosefunction() {  
        var oManager = GetRadWindowManager();  
        var oWnd = oManager.getWindowByName("Win1");  
        oWnd.close();  
    }  
    function GetRadWindow() {  
        var oWindow = null;  
        if (window.radWindow)  
            oWindow = window.radWindow;  
        else if (window.frameElement.radWindow)  
            oWindow = window.frameElement.radWindow;  
        return oWindow;  
    }  
</script> 

-Shinu.

0
Hassan Yasir
Top achievements
Rank 1
answered on 05 May 2010, 07:38 PM
It is working! Thanks alot Shinu.
Tags
Window
Asked by
Hassan Yasir
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Hassan Yasir
Top achievements
Rank 1
Share this question
or