<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UploadPicture.aspx.cs" Inherits="UploadPictureYuri.UploadPicture" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Upload Picture</title>
<link href="Style.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
var timerID = 0;
function Timer()
{
try
{
var guid = opener.document.getElementById('new_pictureid').value;
opener.document.getElementById('ContactPic').src = '/Activities/Attachment/download.aspx?AttachmentType=5&AttachmentId=' + guid ;
clearInterval(timerID);
top.close();
}
catch (e)
{
alert(e.message);
}
}
function ReloadImage()
{
try
{
opener.document.getElementById('ContactPic').src = "";
timerID = setInterval(Timer,200);
}
catch (e)
{
alert(e.message);
}
}
function CloseSelfNoWarning() {
window.opener = 'dummy';
window.open('','_parent','');
window.close();
return false;
}
function CloseWindow()
{
parent.close();
}
// var logo;
// window.onload = function()
// {
// var link = document.getElementById('btnUpload');
// if(link)
// {
// link.onclick = function()
// {
// if(!logo)logo = document.getElementById('logo');
// if(logo)
// {
// logo.style.display = (!logo.style.display || logo.style.display == 'none') ? 'inline' : 'none';
// }
// }
// }
// }
function Test()
{
debugger
var img = parent.getElementById('logo');
img.style.display == 'none';
}
function Test2()
{
var img = parent.getElementById('logo');
img.style.display == 'inline';
}
</script>
<style type="text/css">
#logo {
display:none;
}
</style>
</head>
<body>
<form id="form1" runat="server" onsubmit="Test();" onload="Test2();">
<div id="top" style="padding-left: 10px; background-color: #6693cf; height: 50px;
font-weight: bold; font-size: 14pt; text-transform: none; color: #ffffff; font-family: Tahoma;">
Upload contact picture<br />
</div>
<div>
<br />
<asp:FileUpload ID="uploadFile" runat="server" CssClass="upload"/><br /><br />
<br />
<asp:Button ID="btnUpload" runat="server" Text="Upload" OnClick="btnUpload_Click" CssClass="button"/>
<input type="Button" value="Close" class="button" onclick="ReloadImage(); CloseSelfNoWarning();" id="Button1" />
</div>
</form>
</body>
<% this.ClientScript(); %>
</html>