Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
WebHostForAsp.net
 


  Sponsors  

Meet Our Sponsors

The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  Authentication ...  I am unable to use file upload control in user account module of dnn 481
Previous Previous
 
Next Next
New Post 5/12/2008 3:38 AM
Resolved
User is offline shreekala
5 posts
10th Ranked


I am unable to use file upload control in user account module of dnn 481 

I used file upload control for uploading photo but its throwing error "object reference not set to an instance of an object" only in dnn 481,dnn 482 versions. I used same control in dnn 470 version there it works fine.

 
New Post 5/12/2008 8:21 AM
User is offline Mike Horton
2672 posts
dnn.gmss.org
5th Ranked






Re: I am unable to use file upload control in user account module of dnn 481 

Without seeing the code you're using it's difficult to know where the problem is.

 
New Post 5/12/2008 9:30 PM
User is offline shreekala
5 posts
10th Ranked


Re: I am unable to use file upload control in user account module of dnn 481 

Hello Sir,

Please see the code below

I used btn as  asp button control,fu as asp file upload control,img as asp image control

I am getting error in  this line  " contLength = fu.PostedFile.ContentLength" as object refererence not set to an instance of an object.
I am able to get file upload control's ID but I am not able to  capturethe content of that upload control.

Pls give me a soln.

Protected Sub btn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn.Click
            Dim contLength As Integer
            contLength = fu.PostedFile.ContentLength
            Dim myData(contLength) As Byte
            fu.PostedFile.InputStream.Read(myData, 0, contLength)
            Dim strpath As String = "C:\Inetpub\wwwroot\iredver1.0\CompanyLogo"
            Dim strfileName As String = Path.GetFileName(fu.PostedFile.FileName)
            Dim strpth As String = ""
            strpth = Path.Combine(strpath, strfileName)
            fu.SaveAs(strpth)
            img.ImageUrl = strpth

  End Sub

 

 
New Post 5/13/2008 2:52 PM
User is offline Mike Horton
2672 posts
dnn.gmss.org
5th Ranked






Re: I am unable to use file upload control in user account module of dnn 481 

It looks to me like the value for fu isnot being kept. Is this a global variable? This isn't so much a problem with any of the authentication codes but rather with something core related or with your code itself.

 
New Post 5/13/2008 6:40 PM
Accepted Answer 
User is offline William Severance
576 posts
www.wesnetdesigns.com
8th Ranked




Re: I am unable to use file upload control in user account module of dnn 481 

If your module is wrapped in an AJAX UpdatePanel or has "Supports Partial Rendering" checked in the module's control definition, the FileUpload control will not be able to perform the upload as it requires a full postback. Without a full postback, the property fu.PostedFile would always be null.

If you want to use an AJAX UpdatePanel or "Supports Partial Rendering",  the button control which triggers the upload will need to be registered as a PostBackControl in the module control's Page_Init or Page_Load handler. As the following code will need to be called each time the page loads, do NOT place it within a If Not Page.IsPostback condition:

If DotNetNuke.Framework.AJAX.IsEnabled Then
      DotNetNuke.Framework.AJAX.RegisterPostBackControl(btn)
End If

As an aside, you might also like to check out my ImageEditorControl for DNN at www.codeplex/imageeditor as it provides file upload, image preview, and basic image editing including cropping and enhancement, auto-resizing and thumbnailing, and save to any of the DNN file storage systems.


Bill, WESNet Designs
 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  Authentication ...  I am unable to use file upload control in user account module of dnn 481
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Smart-Thinker
DNN Modules for Social Networks for as low as $69 for 6 modules! We also maintain the DotNetNuke Directory - http://DNNDir.com
www.smart-thinker.com
DNN Photo Gallery
Complete Photo Gallery Management!
www.dnnPhotoGallery.com
R2i - Delivering Serious DNN Services & Solutions
Award Winning Design, Skin construction, Custom Modules and Consulting Services for the Enterprise organization. R2i is the DNN:Map module Project Lead and one of the largest DNN service providers with offices in New York City, Virginia and Baltimore.
www.bi4ce.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP