0

I need to show an message using radalert in all the content pages associated with the master page.

I am not able to add the JavaScript code to the master page, so i had to add the below specified code in external JavaScript file.

When the below specified code is added to the content page, it displays the message before session expires. JavaScript code:

 var sessionTimeoutWarning = "1";
 var sessionTimeout = "2";
 var timeOnPageLoad = new Date();

setTimeout('RedirectToWelcomePage()', parseInt(sessionTimeout) * 60 * 1000);

 function RedirectToWelcomePage() {
        var message = "Session expired. Redirecting to Login page";
        radalert(message, 320, 100, "Information Message");
        window.location = "Login.aspx"
    }   

But when the code is added to the external javascipt file so that it can be implemented in all the pages dependent on the master page it gives "Unable to get property 'radalert' of undefined or null reference" error at the radalert

1 Answer 1

1

If you are accessing radcontrols from external javascript. You should be aware of parameters for that function..

For example :

function open()
{
window.open("Hello World", 320, 100, "Information Message");
}

The above script is not as same for Radcontrols. You need to add parameters

function open(sender, args)
{
radalert("Hello World", 320, 100, "Information Message");
}
Sign up to request clarification or add additional context in comments.

2 Comments

Is there any other way to call radalert independently without putting that inside function? The requirement that I have is to display a prompt to the user before the session expires but if I put that in function it will not check the for the time difference. So I need it to be independent.
i'm not getting you. please elaborate with an EDIT

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.