tags:

views:

17

answers:

2

I've got a scenario where I need to figure out how to make windows pop up depending on a session variable. So if a certain session value is something, then display a pop up with a message on the screen. Anybody know how to takle it?

A: 

How often does this need to happen? On page refresh you could check the session variable in your code behind file and pass down some javescript in the page to do a pop up. (or a simple alert() ?)

If it needs to happen more often than page refresh, you'll have to do the same thing but use an ajax timer that calls to the server to check if the session variable changed.

CraigF
It's probably going to happen alot. I'm working on this insurance claims project, so depending on the customer phone number and session id, we need to be able to pop up windows.
Jeff
+1  A: 

Assuming C#:

<% if (Session("variable") == "bob") { %>
<script type="text/javascript">
window.open ("/path/to/window/url","Window Title");
</script>
<% } %>

Assuming VB:

<% If (Session("variable") = "bob") Then %>
<script type="text/javascript">
window.open ("/path/to/window/url","Window Title");
</script>
<% End If %>
Parrots