Page Language AutoEventWireup true CodeBehind UploadPicture aspx cs In

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
<%@ 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" />&nbsp;
</div>
</form>
</body>
<% this.ClientScript(); %>
</html>