Dotnetnuke Error: BC30451
December 14th, 2008 Filed Under Dotnetnuke
For all interested parties if you run into this error after compiling a custom module…
Dotnetnuke BC30451: Name ‘Initialize’ is not declared.
It is most likely you didn’t change your reference paths in Visual Studio.
Brian Dukes ran into this problem, discussed here. His solution was to copy a fresh copy of the core Dotnetnuke.dll into your root /bin folders but if you don’t change the reference paths in Visual Studio, each time you compile your custom module the Dotnetnuke.dll will be replaced with the an older one if it exists.
Don’t forget to change the reference paths for both your main module project and the corresponding sqldataprovider project because it will also have the same reference paths.
HTH, Thuan.
1,512 Views |
Permalink | Trackback |
|
Print This Article | Leave a Comment
Dotnetnuke Infinite Redirect Loop
December 13th, 2008 Filed Under Dotnetnuke
It had be a long time since I had worked with Dotnetnuke but it was time for me to upgrade a few of my Dotnetnuke sites. And as always DNN’s installation/upgrading is again culpable for all my recent stress.
The site upgrade in question was going from DNN 3.3.7 to DNN 4.9.0 and the error I kept on getting was an infinite loop redirecting me back to this URL: http://mysite/default.aspx?alias=http://mysite/myalias with a blank screen.
Internet Explorer didn’t know what to do with it so it infinitely reloaded the URL. Firefox was a little smarter, it detected the loop therefore stopped it and gave out this error message: “Firefox has detected that the server is redirecting the request for this address in a way that will never complete.”
So the search was on, using these keywords… dotnetnuke, infinite, redirect, and loop. I found a couple promising articles with potential solutions to my problem…
http://www.bestwebsites.co.nz/dotnetnuke/solving-the-dotnetnuke-redirect-loop/
But after much trial and error with my trust settings and going straight to the database and changing my portal’s aliases per those solutions, I was still at a dead end.
It wasn’t until I carefully read this John Mitchell forum thread did I find my solution. The problem was the new Default.aspx page. After the upgrade the page code went from…
<%@ Page Language=”vb” AutoEventWireup=”false” Explicit=”True” Inherits=”DotNetNuke.Framework.DefaultPage” CodeFile=”Default.aspx.vb” %>
<%@ Register TagPrefix=”dnn” Namespace=”DotNetNuke.Common.Controls” Assembly=”DotNetNuke” %>
<asp:literal id=”skinDocType” runat=”server”></asp:literal>
<html <%=xmlns%> <%=LanguageCode%>>
<head id=”Head” runat=”server”>
<meta id=”MetaRefresh” runat=”Server” http-equiv=”Refresh” name=”Refresh” />
<meta id=”MetaDescription” runat=”Server” name=”DESCRIPTION” />
<meta id=”MetaKeywords” runat=”Server” name=”KEYWORDS” />
<meta id=”MetaCopyright” runat=”Server” name=”COPYRIGHT” />
<meta id=”MetaGenerator” runat=”Server” name=”GENERATOR” />
<meta id=”MetaAuthor” runat=”Server” name=”AUTHOR” />
<meta name=”RESOURCE-TYPE” content=”DOCUMENT” />
<meta name=”DISTRIBUTION” content=”GLOBAL” />
<meta name=”ROBOTS” content=”INDEX, FOLLOW” />
<meta name=”REVISIT-AFTER” content=”1 DAYS” />
<meta name=”RATING” content=”GENERAL” />
<meta http-equiv=”PAGE-ENTER” content=”RevealTrans(Duration=0,Transition=1)” />
<style type=”text/css” id=”StylePlaceholder” runat=”server”></style>
<asp:placeholder id=”CSS” runat=”server” />
</head>
<body id=”Body” runat=”server” >
<noscript></noscript>
<dnn:Form id=”Form” runat=”server” ENCTYPE=”multipart/form-data” style=”height: 100%;” autocomplete=”off”>
<asp:Label ID=”SkinError” runat=”server” CssClass=”NormalRed” Visible=”False”></asp:Label>
<asp:PlaceHolder ID=”SkinPlaceHolder” runat=”server” />
<input id=”ScrollTop” runat=”server” name=”ScrollTop” type=”hidden” />
<input id=”__dnnVariable” runat=”server” name=”__dnnVariable” type=”hidden” />
</dnn:Form>
</body>
</html>
to…
<%@ Page language=”VB” %>
<%@ Import Namespace=”DotNetNuke” %><script runat=”server”>
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim DomainName As String
Dim ServerPath As String
Dim URL() As String
Dim intURL As Integer‘ parse the Request URL into a Domain Name token
URL = Split(Request.Url.ToString(), “/”)
For intURL = 2 To URL.GetUpperBound(0)
Select Case URL(intURL).ToLower
Case “admin”, “desktopmodules”, “mobilemodules”, “premiummodules”
Exit For
Case Else
‘ check if filename
If InStr(1, URL(intURL), “.aspx”) = 0 Then
DomainName = DomainName & IIf(DomainName <> “”, “/”, “”) & URL(intURL)
Else
Exit For
End If
End Select
Next intURL‘ format the Request.ApplicationPath
ServerPath = Request.ApplicationPath
If Mid(ServerPath, Len(ServerPath), 1) <> “/” Then
ServerPath = ServerPath & “/”
End IfDomainName = ServerPath & “Default.aspx?alias=” & DomainName
Response.Redirect(DomainName,True)
End Sub
</script>
This made me look at all my files a second time. What I found was that the old Default.aspx was backed up as old_Default.aspx and a new one was created. So my solution was simply to replace the original Default.aspx page with the new one generated from the upgrade.
And although, my solution got the site working again and under ASP.NET v2 (the reason for my upgrade), it also leaves me to question what I did, if I messed anything fundamental up, and why the Dotnetnuke Team changed the Default.aspx page.
If anyone could enlighten me on this, please leave a comment.
5,184 Views |
Permalink | Trackback |
|
Print This Article | 1 Comment
ASP.net 1.1 Repeater Columns
November 13th, 2007 Filed Under ASP.net 1.1, Code, Dotnetnuke
While writing a script to mass approve posts on a site, similar to deleting all unwanted email using: a repeater (not a datagrid), a checkbox in each indexItem, and a button; I ran into a common problem for many… ASP.net repeaters don’t have columns. I searched the net and visited two of my favorite forums looking for help and came up with nothing…
Here’s my Psuedo/Logic:
1) Load Repeater with list of “UNmoderated” items
2) Put a checkbox inside the repeaters ItemTemplate
3) Add code to button (dosomething if checkbox is checked)
Problem:
I couldn’t locate the column with the PrimaryUniqueID because there are no columns in repeaters, but my Stored Procedure “requires” the PrimaryUniqueID.
Button code:
Private Sub MassApprove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MassApprove.Click
Try
Dim MyRptItem As RepeaterItem
For Each MyRptItem In MyRepeater.Items
Dim chbxMassApprove As CheckBox = CType(MyRptItem.FindControl(“chbxMassApprove”), CheckBox)
Dim PrimaryUniqueID As String = MyRptItem.DataItem(PrimaryUniqueID)PROBLEMATIC LINE
If chbxMassApprove.Checked = True Then
‘DO THE MASS APPROVE
‘LOOP THRU STORED PROCEDURE
End If
Next
Catch exc As Exception
Response.Write(exc.ToString)
End Try
End Sub
Solution:
I used this as a workaround if this helps anyone…
Front End:
Text=’<%# DataBinder.Eval(Container, “DataItem.PrimaryUniqueID”) %>’Back End:
Dim PrimaryUniqueID As String = ckbxMassApprove.Text.ToString
780 Views |
Permalink | Trackback |
|
Print This Article | 1 Comment
ASP.net Paging
October 18th, 2007 Filed Under Code, Dotnetnuke
So, the users of a certain website of mine have been requesting that I add paging to one of my controls. I initially didn’t want to do it, not because I couldn’t do it. But because the control didn’t really call for it. But they are my users, without them the site wouldn’t be there right? So I went ahead with it. Its been a while since I used any paging code, so I was refreshed after reviewing ASP.net paging webcontrols:
System.Web.UI.WebControls.PagedDataSource
What we have to do for us to paging through our data vs. displaying all of it at once? We simply inject the paging into our data before displaying it. In my case, I am using a repeater:
'get the data
Dim myData As System.Collections.ArrayList
myData = ** myStoredProcedure **
'ensure there is data to work with
If myData .Count > 0 Then
'create a new instance of PagedDataSource
myPagedDataSource = New System.Web.UI.WebControls.PagedDataSource
'set my pagin preferences
myPagedDataSource.DataSource = myData
myPagedDataSource.AllowPaging = True
myPagedDataSource.PageSize = 5
myPagedDataSource.CurrentPageIndex = myCurrentPageIndex
'then finally bind the data to my repeater
myRepeater.DataSource = myPagedDataSource
myRepeater.DataBind()
End If
Quite simple to use. Knowing that the webcontrol is there really is the hard part of it all.
274 Views |
Permalink | Trackback |
|
Print This Article | Leave a Comment
Free Dotnetnuke Skins
October 11th, 2007 Filed Under Dotnetnuke
I wanted to have freedotnetnukeskins.com up and running by November 1, 2007. But with the way things are going with Lunarpages.com… I am going to have to wait until 2008.
255 Views |
Permalink | Trackback |
|
Print This Article | Leave a Comment
DNN Installs
October 8th, 2007 Filed Under Design, Dotnetnuke, Web
Installing DNN on shared hosting as always been a hard task. And to think I’d have it down by now. I at least remember by heart the basics:
- Download the software from the DNN site
- Upload the files to the shared hosting
- Ensure permissions for the ASP.net user are correct
- Setup the database and user
- Config the webconfig, ie. enter in the DB connection data/string
- Go to browser, invoke install @ http://mydomain.com/install
- Change admin and host passwords
Thats is normally it, unless you run into permissions problems; which is often on shared hosting servers.
But while trying to setup my Freedotnetnukeskins.com on Lunarpages.com servers, we (support and I) discovered that the directory “skins” CANNOT be used as your virtual directory. My guess is this might be in the DNN manual somewhere, but we were using the “auto install DNN” plesk so it was hard to pick out.
266 Views |
Permalink | Trackback |
|
Print This Article | Leave a Comment