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...Building ExtensionsBuilding ExtensionsModulesModulesModule Error -  error BC30456: 'TextBox1_OnTextChanged' is not a member of ...Module Error - error BC30456: 'TextBox1_OnTextChanged' is not a member of ...
Previous
 
Next
New Post
8/5/2014 3:28 PM
 

Im trying to basically transfer asp.net pages into modules, so what ive done on here (in order to avoid posting 1000 lines) is to recreate simple parts of the pages. I posted above the call to the function and the function itself. Everything else is noted above regarding the formation of the ascx files. So its just going 

Main.ascx.vb:
(imports section)

Namespace StaffLookup
    Public Class Main
        Inherits PortalModuleBase

 

 

        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        End Sub

        Public Function ProcessPictures() As String
                Return "http://info/scripts/personnel/IDVerify/BadgePictures/transparent.jpg"
        End Function

    End Class
End Namespace

Main.ascx:
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="Main.ascx.vb" Inherits="StaffLookup.Main" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
<img src='<%# ProcessPictures()%>'  />
    </form>
</body>
</html>



My designer file i had to manually add     Inherits PortalModuleBase into the class because Visual Studios did not add it automatically. My question is what else could be missing in order to make main.ascx.vb see functions (or other subs) within the namespace of Main.ascx. 

 
New Post
8/5/2014 4:21 PM
 
Well... one quick problem I see is that you have the html, head, body, form, etc. tags...

You're using a user control - a .ascx file. So, it will be embedded in a page that already has that stuff. In other words... you'd only need the image tag and the header line.

Also, that's sort of an odd way of doing webforms... You might try something more like this:

EDIT: DNN cut off the image tag... just a tag of: asp:image runat="server" id="imgPictures

then

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack()
ProcessPictures()
End If
End Sub

Public Sub ProcessPictures()
me.imgPictures.ImageURL = "http://info/scripts/personnel/IDVerify/BadgePictures/transparent.jpg"
End Function



Mike
 
New Post
8/5/2014 4:32 PM
 

oh ok ill cut out the html parts and see what i can do from there. As for the image, it is probably a bad example...but the app im trying to recreate into a module is a gridview that is populated from a sql query. it provides a list of employees. Where the function call comes in is where I have a column of staff pictures ( placed into a gridview item template). However the pictures (which are pulled in from the database) are only displayed IF certain critera is met. Thats why i called a function from there like that

 
New Post
8/5/2014 4:36 PM
 
OK....

Well, another thing to always keep in mind with DNN (or most CMSs) is that it's good to use the framework when possible. I don't know the specifics of your situation here, but, if those staff all have accounts on your site, then you can do that just as easily with existing tools and modules.

That probably doesn't apply here, but, since you seem to be new to DNN module development, I thought I'd mention it.

Oh - and if you're struggling, and using a recent version of DNN, you can also try the module creator as a way to get started. You do that by using the host account and adding that module to a page.

Mike
 
New Post
8/5/2014 10:28 PM
 
I'd bet that your namespace is not what you think it is. You are using VB so look in the project settings for Root Namespace. In VB the Root Namespace is automagically wrapped round all your code files. So...

If you write in the code files (xxx.vb) let's say
Class xxx
Then the full name is [Root Namespace].xxx

In the designer file, up at the top, it needs the FULL name ie Inherits="[Root Namespace].xxx"

You should NOT need the Inherits in the designer file. It's a partial class; it can only have one base; normal practise is to leave it out of the .Designer file. My memory is that if you write inherits in more than one part of a partial class it is allowed, but they have to be identical. As Mike said Visual Studio normally manages the designer file for you so it's usually best to keep your fingers out of it.

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesModule Error -  error BC30456: 'TextBox1_OnTextChanged' is not a member of ...Module Error - error BC30456: 'TextBox1_OnTextChanged' is not a member of ...


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