Hello,
I'm working on using the uploader in an MVC application and one of the things we need to do is disable some things on the page while an upload is occuring. I read other posts saying to use the CuteWebUI_AjaxUploader_OnStart() function but it isn't being called! the OnStop function is not being called either. The On_Postback() does get called.
Here's my View code:
- <%@ Page Title="" Language="VB" MasterPageFile="~/Views/Shared/ExtraPlain.Master" Inherits="System.Web.Mvc.ViewPage" %>
-
-
- <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
- <script type="text/javascript">
- var handlerurl = '<%=Url.Action("AjaxSubmit", "FileUpload") %>'
- </script>
- <script type="text/javascript">
- function CuteWebUI_AjaxUploader_OnStart() {
-
-
- $('#SendMail').attr("disabled", "disabled");
- document.getElementById("SendMail").disabled = "disabled";
- alert("hello");
-
-
- }
- function CuteWebUI_AjaxUploader_OnStop() {
-
- $('#SendMail').removeAttr("disabled");
- alert("hello");
- }
-
-
-
- function CuteWebUI_AjaxUploader_OnPostback()
- {
-
-
- var uploader = document.getElementById("TheFileUploader");
- var guidlist = uploader.value;
- var otherinfo = document.getElementById("otherinfo").innerHTML;
-
-
- $.post(
- handlerurl,
- { guidlist: guidlist, otherinfo: otherinfo },
- function(data, status) {
- if (status != "success") {
- alert("http error " + status);
- setTimeout(function() { document.write(xh.responseText); }, 10);
- return;
- }
-
- var filelist = document.getElementById("filelist");
-
- var list = eval(data);
-
- for (var i = 0; i < list.length; i++)
- {
- var item = list[i];
- var msg;
- if (item.Error != null)
- {
- msg = "Error " + item.FileGuid + " - " + item.Error;
- }
- else
- {
- msg = "Processed : " + list[i].FileName;
- }
- var li = document.createElement("li");
- li.innerHTML = msg;
- filelist.appendChild(li);
-
- }
-
-
- }
- );
- uploader.reset();
- $('#SendMail').removeAttr("disabled");
- }
-
- </script>
-
- <button id="uploadbutton" onclick="return false;" name="uploadbutton">Select file(s) to upload</button>
- <%=ViewData("uploaderhtml") %>
- <ol id="filelist"></ol>
-
- <div id="otherinfo" name="otherinfo" style="display:none;">Hello!</div>
- <input type="button" id="SendMail" name="SendMail" value="SendMail" />
-
- </asp:Content>
Any idea where i'm going wrong?
Thanks!