I am trying to work with your samples on how to use a progress indicator when uploading files. I am fairly new to asp.net, so bare with me.
I am in your ConcurrentUpload example, looking at default.aspx
In your code, you have this as a javascript function:
function ImageUploader1_Progress(Status, Progress, ValueMax, Value, StatusText)
And in that function you have this:
var iu = new ImageUploaderWriter("ImageUploader1", 650, 400);
Now I don't want to create the control right there in the javascript. I want to create it in the html markup, such as:
<div>
<cc1:ImageUploader ID="ImageUploader1" runat="server" Height="475px"
Width="700px" OnClientAfterUpload="ClientAfterUpload">
</cc1:ImageUploader>
<br />
</div>
The reason I want to do this is to be able to set settings there, and more importantly, so my aspx.vb code can know the control is there, and work with it.
Private Sub ImageUploader1_FileUploaded(ByVal sender As Object, ByVal e As Aurigma.ImageUploader.FileUploadEventArgs) Handles ImageUploader1.FileUploaded
I tried to change the javascript line from:
var iu = new ImageUploaderWriter("ImageUploader1", 650, 400);
To:
var imageUploader = getImageUploader("ImageUploader1");
But that does not seem to work.
Here is the code I am using... I probably have it structured incorrectly.
Please tell me what items might not be correct here. I am really unsure about the style type="text/css" area, if the pound sign # should be there.
<body>
<form id="form1" runat="server">
<input type="hidden" id="StopUploading" runat="server"/>
<div>
<cc1:ImageUploader ID="ImageUploader1" runat="server" Height="475px"
Width="700px" OnClientAfterUpload="ClientAfterUpload">
</cc1:ImageUploader>
<br />
</div>
<div id="StatusBar"></div>
</form>
</body>
</html>
<script type="text/javascript" src="iuembed.js"></script>
<script type="text/javascript">
// var iu = new ImageUploaderWriter("ImageUploader", 700, 475);
var imageUploader = getImageUploader("ImageUploader1");
iu.fullPageLoadListenerName="SetStatusText";
iu.addEventListener("FolderChange", "SetStatusText");
iu.addEventListener("UploadFileCountChange", "SetStatusText");
iu.writeHtml();
function ClientAfterUpload(Html)
{
}
function SetStatusText() {
var imageUploader = getImageUploader("ImageUploader1");
var statusBar = document.getElementById("StatusBar");
statusBar.style.visibility = "visible";
var cnt = imageUploader.getPaneItemCount("FolderPane");
var text = cnt + " item(s)";
cnt = imageUploader.getUploadFileCount();
statusBar.innerHTML =
(cnt > 0) ? text + ". " + cnt + " selected for upload" : text;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
#StatusBar {
width: 650px; /* width of Image Uploader control/applet */
visibility: hidden; /* hide the status bar by default */
text-align: right;
font-weight: bold;
border: solid black 1px;
background: white;
padding: 3px;}
</style>
</head>
Edited by user Tuesday, March 16, 2010 10:24:24 PM(UTC)
| Reason: Not specified