My requirement is to pop up a window( with company policies) only the
first time a user logs into sharepoint.
I wrote a C# web application and used session variables, it worked.
Then i wrote a web part application it didnt work because the web part
always run even if the browser is closed.
Then after search and research i came to know that i have to set up
session variable in the global.asax file of the sharepoint. But i'm
not able to find a way to do it. How to set session variables in
global.asax file?
This is my C# web Application page_load event.
private void Page_Load(object sender, System.EventArgs e)
{
if (Session["showPopUp"] == null)
{
Response.Write("Session is not set. Show PopUp <br>");
Response.Write("<script language='JavaScript'> var newwindow;
newwindow=window.open('http://abc.com','mywindow','width=500,height=500');
newwindow.focus();</script>");
// Set the session here
Session["showPopUp"] = "true";
}
else
{
Response.Write("Session is set. Do not show PopUp <br>");
}
}