如何在没有 DAL 的情况下创建简单的 Dotnetnuke 模块

发布于 2024-09-07 04:02:06 字数 906 浏览 0 评论 0原文

几天来我一直在寻找方法来做到这一点......这真的要了我的命......任何人,请帮忙。

我想在 DNN (VB) 中创建一个新模块......

1. does not use DAL or DAL+
2. has only one view.ascx control
3. It has to be a compiled module

我不需要数据库连接和任何花里胡哨的东西,只需要一种视图控制。我以为这会很简单,但现在谷歌搜索了一天,它看起来很复杂。

任何愿意一步步发布的人...那就太棒了...

I have the development environment already set up with;
1. DNN Starter kit
2. VS 2008
3. SQL server
4. DNN up and running in IIS
5. the project builds successfully

如果有人知道一种方法,我可以使用 VS 2008 中的 DNN 动态模块模板构建模块,然后剥离 DAL 以及所有不必要的层和额外的控件直到我只有一个工作 view.ascx 只打印出“Hello World!”到屏幕上...那就太好了!

非常感谢, 诺曼.

PS:(我还尝试了 adefwebserver.com 上的 hello world 教程 (http ://www.adefwebserver.com/DotNetNukeHELP/DNN5_HelloWorld/Default.htm)- 并且该向导不会像教程中那样显示。)

I've been looking for ways to do this for days now ... and its really killin' me ... anyone, please help.

I want to create a new module in DNN (VB) ... that;

1. does not use DAL or DAL+
2. has only one view.ascx control
3. It has to be a compiled module

I do not need DB connectivity and any bells and whistles just one view control. I thought it would be simple but googling for a day now and it seems very complicated.

Anyone willing to post a step by step ... would be great...

I have the development environment already set up with;
1. DNN Starter kit
2. VS 2008
3. SQL server
4. DNN up and running in IIS
5. the project builds successfully

If anyone knows a way I can build a module using the DNN Dynamic Module Template in VS 2008 and then strip off the DAL and all the unnecessary layers and extra controls until I have only a working view.ascx that just prints out "Hello World!" to the screen ... that would be great !

Thanks a whole bunch,
Norman.

P.S : (I've also tried the hello world tutorial at adefwebserver.com (http://www.adefwebserver.com/DotNetNukeHELP/DNN5_HelloWorld/Default.htm)- and that wizard does'nt show up as it does in the tutorial.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

三生殊途 2024-09-14 04:02:06

当第一次学习诀窍时,我建议从头开始编写并跳过所有模板,咳咳,垃圾。

以下是基本步骤:

  1. 创建一个新的 Visual Studio“ASP.NET Web 应用程序”项目,我在不久前的博客文章中概述了 Web 应用程序项目的基本配置设置:使用 Web 应用程序项目 (WAP) 创建 DotNetNuke 模块
  2. 添加引用DotNetNuke.dll
  3. 添加一个新的 Web 用户控件 (.ascx) 文件 - 将其命名为 View.ascx。
  4. 确保用户控件继承自 PortalModuleBase(见下文)。用一些示例 hello world 代码填写它(再次参见下文)
  5. 您可以将此用户控件(单独)导入到 DNN 中。在DNN 5中,从主机选择“创建新模块”->模块定义页面。
  6. 然后,如果需要,您可以从主机 -> 导出模块包。模块定义或主机 ->扩展页面(但请记住,您需要在本地运行才能导出包,如果您在远程服务器或其他服务器上,它不会让您这样做)

View.ascx:

<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="View.ascx.vb" Inherits="HelloWorld.View" %>

<h1><asp:Literal ID="PageHeaderText" runat="server" /></h1>

View.ascx.vb:

Imports DotNetNuke.Entities.Modules

Partial Public Class View
    Inherits PortalModuleBase

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            PageHeaderText.Text = "Hello World"
        End If
    End Sub

End Class

When first learning the ropes, I'd suggest writing it from scratch and skipping all of the template, ahem, junk.

Here are the basic steps:

  1. Create a new Visual Studio "ASP.NET Web Application" project, I outlined the basic configuration settings for a web application project in a blog post awhile back: Creating DotNetNuke Modules using a Web Application Project (WAP)
  2. Add a reference to the DotNetNuke.dll
  3. Add a new Web User Control (.ascx) file - call it View.ascx.
  4. Make sure the user control inherits from PortalModuleBase (see below). Fill it out with some sample hello world code (again, see below)
  5. You can import this user control (by itself) into DNN. In DNN 5, select "Create New Module" from the host -> module definitions page.
  6. You can then export the module package, if desired, from the Host -> Module Definitions or Host -> Extensions page (keep in mind though, you need to be running locally in order to export the package, it won't let you do it if you're on a remote server or something)

View.ascx:

<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="View.ascx.vb" Inherits="HelloWorld.View" %>

<h1><asp:Literal ID="PageHeaderText" runat="server" /></h1>

View.ascx.vb:

Imports DotNetNuke.Entities.Modules

Partial Public Class View
    Inherits PortalModuleBase

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            PageHeaderText.Text = "Hello World"
        End If
    End Sub

End Class
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文