Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0htmlinputfile trick?htmlinputfile trick?
Previous
 
Next
New Post
7/21/2007 5:39 PM
 

I am trying to add file import to one of my modules.  I put htmlinputfile in a control.  It lets me browse to a file and select it, but when I stop at a breakpoint the htmlInputFile control has null for the postedFile and nothing for anything else either.

Since this is the first time I tried this I created a simple one page site and put the control on the default page.  Works fine there.

Is there a trick I need to know about using htmlinputfile inside a dnn module?

Thanks,

Jeff Landry

 
New Post
7/21/2007 9:23 PM
 

There's no special trick required for use of the htmlInputFile control in a module. However, the file upload and setting of properties such as postedFile will not occur until the page postbacks.

1. Where are you setting the breakpoint? AND most importantly . . .

2. Are you using an ASP.NET AJAX UpdatePanel or have you (in the module's control definition) checked "Supports Partial Rendering" which effectively "wraps" the module's control with an UpdatePanel? The htmlInputFile control must be placed OUTSIDE of an UpdatePanel.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
7/22/2007 5:11 PM
 

Thank you.

I set the breakpoint because I wanted to see what was going on.

From my perspective knowing that htmlinputfile doesn't work inside an ASP.NET AJAX UpdatePanel is a trick I didn't know (technically it even qualifies as magic according to the "sufficently advanced technology" rule).  I really appreciate the information, moving the control outside of the updatepanel was the solution to my situation.

Thanks again,

Jeff Landry

 
New Post
7/22/2007 5:35 PM
 

I think you can put the control back in the update panel and use this:

see: http://www.adefwebserver.com/DotNetNukeHELP/Misc/AJAXEmail.htm

 

RegisterPostBackControl AJAX enhancement

This allows for exclusions of controls from UpdatePanel async processing. This was implemented in the UrlControl to prevent partial rending when uploading files (stream operations do not work with partial rendering).

In the AJAX Email example, the button labeled Post Back actually performs a post back while all the other controls in the pnlEmail Panel do not. DotNetNuke.Framework.AJAX.RegisterPostBackControl is used to implement this functionality. Below is the complete implementation for this feature:

VB:

If DotNetNuke.Framework.AJAX.IsInstalled Then
DotNetNuke.Framework.AJAX.RegisterScriptManager()
DotNetNuke.Framework.AJAX.WrapUpdatePanelControl(pnlEmail, True)
DotNetNuke.Framework.AJAX.RegisterPostBackControl(btnPostBack)
End If


C#:

if (DotNetNuke.Framework.AJAX.IsInstalled())
{
DotNetNuke.Framework.AJAX.RegisterScriptManager();
DotNetNuke.Framework.AJAX.WrapUpdatePanelControl(pnlEmail, true);
DotNetNuke.Framework.AJAX.RegisterPostBackControl(btnPostBack);
}


Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
7/22/2007 5:52 PM
 

Thanks for the information.  This is an "if it ain't broke..." situation, but I am certain this bit of info will be useful in the near future.

Jeff Landry

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0htmlinputfile trick?htmlinputfile trick?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out