How to get progressBar to work?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get progressBar to work?

Guest-821

Im kinda new at this and am having difficulty figuring out how to use the dll files.

Im using VS2008, Vista. I tried to drag and drop the Brettle.Web.Neatupload.dll file to the assembly folder as directed in your manual, but it kept complaining about not being compiled with a strong-named key. I used sn (sn -k Brettle.snk), but then i wasnt sure how to add that key and then drop it into the GAC. I tried gacutil..but not sure of the syntax.

So that failing, I just followed along in VS2008, and added a new Toolbox, and then added the Brettle.Web.Neatupload.dll file, and I got the inputFile, progressBar, multiFile etc controls.

Now in my aspx page, when I added an input file, I can see the reference being added, the upload seems to work just fine, my problem right now is that the progress bar doesnt show, both inline or popup. my code is very simple, and I havent made any changes to the web.config file...is there something more that I need to do? ive been following the demo.aspx in the zip file, and when i execute that, i can see the progressbar both inline and popup...i dont see you manipulating code to manually make the progress bar show progress...so im trying to figure out what im missing.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="Brettle.Web.NeatUpload" Namespace="Brettle.Web.NeatUpload"

TagPrefix="Upload" %>

<!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></title>

</head>

<body>

<form id="form1" runat="server">

<div>

<Upload:InputFile ID="InputFile1" runat="server" /> <br/>

<asp:Button ID="btnUpload" runat="server" Text="Upload"

onclick="btnUpload_Click" />

<br />

<Upload:ProgressBar ID="ProgressBar1" runat="server" Triggers="btnUpload" />

</div>

</form>

</body>

</html>

aspx.cs:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

}

protected void btnUpload_Click(object sender, EventArgs e)

{

if (InputFile1.HasFile)

{

InputFile1.MoveTo(@"d:\DownloadedXML\test.jpg", Brettle.Web.NeatUpload.MoveToOptions.Overwrite);

}

}

}

Thanks

 

 

Reply | Threaded
Open this post in threaded view
|

Re: How to get progressBar to work?

Dean Brettle
Administrator
Did you remember to...
Add the following line to your Web.config under configuration/system.web/httpModules:
<add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload" />

as described in the installation instructions?

If so, what version of NeatUpload are you using?  Also, please post your web.config (with any sensitive info redacted).


Thanks,

--Dean

 
Reply | Threaded
Open this post in threaded view
|

Re: How to get progressBar to work?

Guest-821

Dean, I had added that to my web.config ...I had set useHttpModule to false, but when i turn it onto 'true' in the popup window for the progressbar, I get the following error:

Server Error in '/TestNeatUpload' Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /TestNeatUpload/NeatUpload/Progress.aspx


Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

Here is my web.config file, the code is unchanged from above.

<?xml version="1.0"?>

<!--

Note: As an alternative to hand editing this file you can use the

web admin tool to configure settings for your application. Use

the Website->Asp.Net Configuration option in Visual Studio.

A full list of settings and comments can be found in

machine.config.comments usually located in

\Windows\Microsoft.Net\Framework\v2.x\Config

-->

<configuration>

<configSections>

<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>

<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>

<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>

<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>

<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>

</sectionGroup>

</sectionGroup>

</sectionGroup>

<sectionGroup name="system.web">

<section name="neatUpload" type="Brettle.Web.NeatUpload.ConfigSectionHandler, Brettle.Web.NeatUpload" allowLocation="true" />

</sectionGroup>

 

</configSections>

<appSettings/>

<connectionStrings/>

<system.web>

<!--

Set compilation debug="true" to insert debugging

symbols into the compiled page. Because this

affects performance, set this value to true only

during development.

-->

 

 

<compilation debug="true">

<assemblies>

<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

</assemblies>

</compilation>

<!--

The <authentication> section enables configuration

of the security authentication mode used by

ASP.NET to identify an incoming user.

-->

<authentication mode="Windows"/>

<!--

The <customErrors> section enables configuration

of what to do if/when an unhandled error occurs

during the execution of a request. Specifically,

it enables developers to configure html error pages

to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

<error statusCode="403" redirect="NoAccess.htm" />

<error statusCode="404" redirect="FileNotFound.htm" />

</customErrors>

-->

<pages>

<controls>

<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

</controls>

</pages>

<httpHandlers>

<remove verb="*" path="*.asmx"/>

<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>

</httpHandlers>

<httpModules>

<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

<add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload" />

</httpModules>

 

<neatUpload useHttpModule="true" maxNormalRequestLength="4096" maxRequestLength="2097151">

</neatUpload>

<httpRuntime maxRequestLength="2097151" executionTimeout="3600" useFullyQualifiedRedirectUrl="true" />

 

</system.web>

<system.codedom>

<compilers>

<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">

<providerOption name="CompilerVersion" value="v3.5"/>

<providerOption name="WarnAsError" value="false"/>

</compiler>

<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">

<providerOption name="CompilerVersion" value="v3.5"/>

<providerOption name="OptionInfer" value="true"/>

<providerOption name="WarnAsError" value="false"/>

</compiler>

</compilers>

</system.codedom>

<!--

The system.webServer section is required for running ASP.NET AJAX under Internet

Information Services 7.0. It is not necessary for previous version of IIS.

-->

<system.webServer>

<validation validateIntegratedModeConfiguration="false"/>

<modules>

<remove name="ScriptModule"/>

<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

</modules>

<handlers>

<remove name="WebServiceHandlerFactory-Integrated"/>

<remove name="ScriptHandlerFactory"/>

<remove name="ScriptHandlerFactoryAppServices"/>

<remove name="ScriptResource"/>

<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

</handlers>

</system.webServer>

<runtime>

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

<dependentAssembly>

<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>

<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>

</dependentAssembly>

<dependentAssembly>

<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>

<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>

</dependentAssembly>

</assemblyBinding>

</runtime>

</configuration>

Reply | Threaded
Open this post in threaded view
|

Re: How to get progressBar to work?

Dean Brettle
Administrator
Did you remember to create a NeatUpload/ subdirectory in your web application by copying NeatUpload-version/NeatUpload/ and its contents?  That subdirectory contains Progress.aspx and associated files.

--Dean
Reply | Threaded
Open this post in threaded view
|

Re: How to get progressBar to work?

Guest-821

I had not done that! I assumed that adding the assembly would have all the contents of Neatupload that were required. I will try that and get back to you.

Even if the dll was applied to the GAC, would this subfolder have to exist in a production website?

Also, how would i add the strong name key to the brettle.web.neatupload dll so that i can add it to the GAC? 

Reply | Threaded
Open this post in threaded view
|

Re: How to get progressBar to work?

Dean Brettle
Administrator
The subfolder would need to exist even if NeatUpload was installed in the GAC.

To answer your other question, I need to know what version of NeatUpload are you using?

--Dean
Reply | Threaded
Open this post in threaded view
|

Re: How to get progressBar to work?

Guest-821

Ok, adding that folder and its content was what i was missing the entire time! Thanks

As for the adding to GAC question with strong-name key etc, its version 1.2.30.

Great work on this control, i was using the DevExpress Upload Control, and they didnt have any of the features you have on yours!

 

Reply | Threaded
Open this post in threaded view
|

Re: How to get progressBar to work?

Dean Brettle
Administrator
NeatUpload 1.2.x requires full-trust but does not need to be installed in the GAC (and is not strong-named).  If you want or need to run your app in an envrionment that does not provide a full-trust, you'll need to use NeatUpload-1.3 (currently at release candidate 6).  NeatUpload-1.3 is strong-named and the hosting provider needs to install it in the GAC to use it in something other than a full-trust environment.  For details, see the Installing NeatUpload section of the NeatUpload-1.3 Manual.

--Dean
Reply | Threaded
Open this post in threaded view
|

Re: How to get progressBar to work?

Torbs
Having trouble with this one now myself.  Originally I found that I didn't have the UploadHttpModule in the web.config, and made sure to have the neatupload folder.  I got this working locally (Visual Studio, running in test mode), but when I uploaded it to the site and tried it there no progressbar again.  There is one glaring difference, this is really only a small part of a larger project and this part is in its own subdirectory of the website when I ran it local I ran it as though this subdirectory was the site.  Now I have uploaded the modified web.config to the subdirectory along with the neatupload folder and all such necesarry things.  (The bin folder is out in the root of the site, as well as a copy of the neatupload folder in case that is where it needs to be)  The project to me is looking as though the UploadHttpModule is NOT loaded as it should be by the web.config (remember in the subfolder) has the line for it.  DO I need to also modify the root web.config file, or does the site need to be restarted on the server?  I work with another individual who really is the main person I generally do small pieces as support to him and so if I need to make overall changes those need to run through him, but if thats what I need to do then that is what I will do.

-Torbs
Reply | Threaded
Open this post in threaded view
|

Re: How to get progressBar to work?

Dean Brettle
Administrator
The UploadHttpModule needs to be added to the <httpModules> section in the root Web.config, not in the subdir.  Also, the NeatUpload folder needs to be directly under the root, not under a subdir.

--Dean