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

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Problems while creating an ImageUpload ControlProblems while creating an ImageUpload Control
Previous
 
Next
New Post
6/9/2009 3:37 PM
 

Hi everyone,

I'm trying to create an ImageUpload Control so that can users add an avatar to their profile online i don't know how it works. I tried to follow this guide : http://www.dnndevzone.com/Library/tabid/126/ArticleId/4/Default.aspx but it keeps giving me inherit errors.

Basically i want to add a FileUpload datatype so that i can add a custom profile field Avatar or Picture with an upload field.
Is there anyone who can help me on my way creating this control or explain to me how exactly to add the foldereditcontrol from the link, it already fails when i tried to write the class.

This is my class ImageControl.ascx.cs

using System;
using DotNetNuke.UI.UserControls;

public partial class ImageUpload : TextEditor
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}
 

and my ascx file:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ImageControl.ascx.cs" Inherits="ImageControl" %>

I'm getting the following error:

Error    1    Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl).    C:\inetpub\wwwroot\dnntestsite\controls\ImageControl.ascx.cs    15    33    http://localhost/dnntestsite/

What am i doing wrong, i want to create a control under this:

I hope someone can help me with this problem.

Thanx in advance!

 
New Post
6/12/2009 9:36 AM
 

In the @Control declaration in ImageControl.ascx you have set Inherits="ImageControl" but in the codefile the class is named ImageUpload. To avoid conflict with other ImageUpload classes, you should also specify your own namespace for this new control.

In addition, although not related to the error you are receiving, your ImageUpload class should inherit from DotNetNuke.UI.WebControls.EditControl.


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
 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Problems while creating an ImageUpload ControlProblems while creating an ImageUpload Control


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