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.0Creating skin object problemCreating skin object problem
Previous
 
Next
New Post
5/2/2007 12:46 PM
 
I am trying to play around with this interesting article about creating a dnn skinobject. I 've successfully managed to replicate the author's code. I placed 3 pieces of gif images, made the reference to them in the xml file it works beautifully.

However when I change something in the vb file it will not show the changes when I reload dotnetnuke portal on the browser. It seems to be caching it and only reading the inherits part of the ascx file. I tested and it is not even touching the codebehind reference to the vb file....

What I don't understand is if the original code work then how is it rendering the code in the vb file? Anyhelp I would appreciate.

This is the article link:
http://www.wwwcoder.com/tabid/68/type/art/parentid/224/site/6373/default.aspx

These are my files:

########################## ImageRotator.ascx ##############################
<%@ Control Language="vb" AutoEventWireup="false" Inherits="DotNetNuke.ImageRotator" CodeBehind="ImageRotator.ascx.vb" %>



######################Horizontal Menu - Fixed Width.ascx ###################
<%@ Register TagPrefix="lrd" TagName="ROTIMAGE" Src="~/SkinObjects/RotatingImage/ImageRotator.ascx" %>
.
.
.



#################ImageRotator.ascx.vb####################

Imports System.Web
Imports System.Xml
Imports System.Xml.XPath
Imports DotNetNuke

Namespace DotNetNuke
Public MustInherit Class ImageRotator
Inherits DotNetNuke.UI.Skins.SkinObjectBase
Protected WithEvents imgMain As System.Web.UI.WebControls.Image
Private mXMLFile As String = "default.xml"

#Region "Public Members"
Public Property XMLFile() As String
Get
Return mXMLFile
End Get
Set(ByVal Value As String)
mXMLFile = Value
End Set
End Property
#End Region

#Region "Event Handlers"
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
GetImageInfo()
Catch exc As Exception 'Module failed to load
DotNetNuke.Services.Exceptions.ProcessModuleLoadException(Me, exc)
End Try
End Sub
#End Region

#Region "Private Members"
Private Sub GetImageInfo()
Dim xpathDoc As XPathDocument
Dim xmlNav As XPathNavigator
Dim xmlNI As XPathNodeIterator
xpathDoc = New XPathDocument(Server.MapPath(DotNetNuke.Common.ApplicationPath) & "\SkinObjects\RotatingImage\" & mXMLFile)
xmlNav = xpathDoc.CreateNavigator()
xmlNI = xmlNav.Select("/images/image")
Dim rndNode As Integer = RandomNumber(xmlNI.Count(), 0)
Dim xCnt As Integer = 0
While (xmlNI.MoveNext())
If xCnt = rndNode Then
imgMain.ImageUrl = xmlNI.Current.GetAttribute("src", "")
imgMain.AlternateText = xmlNI.Current.GetAttribute("alt", "")
End If
xCnt = xCnt + 1
End While
End Sub

Private Function RandomNumber(ByVal MaxNumber As Integer, Optional ByVal MinNumber As Integer = 0) As Integer
'initialize random number generator
Dim r As New Random(System.DateTime.Now.Millisecond)
'if passed incorrect arguments, swap them
'can also throw exception or return 0
If MinNumber > MaxNumber Then
Dim t As Integer = MinNumber
MinNumber = MaxNumber
MaxNumber = t
End If
Return r.Next(MinNumber, MaxNumber)
End Function

#End Region

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
Private Sub InitializeComponent()

End Sub

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()

End Sub

#End Region

End Class
End Namespace


Thank you

Rod
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Creating skin object problemCreating skin object problem


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