Make sure to pass in portalAlias, else DNN will log you out.
****serverSideCode*****
Dim s As String = "openEmailWindow('" & PortalAlias.HTTPAlias & "','http://" & Page.Request.Url.Host & Page.Request.Url.AbsolutePath.Replace("Default.aspx", "") & "')"
ImageButton1.Attributes.Add("onClick", s)
****clientSideCode****
//portalAlias="alias=somehostname/dnnwebsite/iisSiteName"//this is required by dnn security
function openEmailWindow(portalAlias,whereAmIGoing){
//open MessageWindow
newX = screen.availWidth-320;
newY = screen.availHeight;//-155
arg1=whereAmIGoing + "SendWCFMail.aspx?alias="+portalAlias;
arg2="SendMail";//'_blank' would open a new popup window, but we want only one instance of the script to controll the messages
arg3=",width=300,height=75,left="+newX+",top="+newY+",toolbar=no,directories=no,status=no,linemenubar=no,scrollbars=no,resizable=no,titlebar=no";
window.open(arg1,arg2,arg3)
return false;
}//openEmailWindow
Best regards,
Sean Gahan