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  |  

DotNetNuke Marketplace
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Iron Speed Designer is a software development tool for building database, reporting, and forms applications for .NET without hand-coding.
 


  Sponsors  

Meet Our Sponsors

MadCap Software, Inc.
AspDotNetStoreFront - E-Commerce by Design - The Leading ASP.NET shopping cart platform for developers!
Click here to go to dev.live.com for Windows Live developer resources
SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
 


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.

 


MaximumASP
MaximumASP provides a wide array of web hosting plans to fit any hosting need. We also provide software and services needed to keep it running optimally.
MaximumASP.com
Mad Development: dotnetnuke design and development
We are an expert Dotnetnuke shop specializing in developing solutions that merge the requirements of design and branding, content management, ecommerce, search engine optimization and business logic.
www.MadDevelopment.com
telerik
telerik r.a.d.controls suite is the most innovative and comprehensive toolset for ASP.NET development, tailored for seamless integration with the DotNetNuke project. This integrated collection of controls allows professionals to build web-solutions with the UI richness and responsiveness of desktop applications.
dnn.telerik.com

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