⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 articlelist.ascx.vb

📁 Module articles for Dot Net Nuke 3.x.x , 4.x.x
💻 VB
字号:
Imports Microsoft.VisualBasic
Imports System.Collections
Imports System.Data
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports DotNetNuke.Security
Imports DotNetNuke.Services.Localization

Namespace EfficionConsulting.Articles
Public MustInherit Class ArticleList
	Inherits DotNetNuke.Entities.Modules.PortalModuleBase
	Implements Entities.Modules.IActionable
	Implements Entities.Modules.IPortable
	Implements Entities.Modules.ISearchable

#Region "Controls"
	Protected WithEvents lstArticles As ArticleListBase
	Protected WithEvents lblSearchResults As System.Web.UI.WebControls.Label
	'Protected WithEvents lblCategory As System.Web.UI.WebControls.Label
	Protected WithEvents objPlaceholder As System.Web.UI.WebControls.PlaceHolder

	Protected WithEvents pnlSearch As System.Web.UI.WebControls.Panel
	Protected WithEvents txtSearch As System.Web.UI.WebControls.TextBox
	Protected WithEvents cmdSearch As System.Web.UI.WebControls.LinkButton
#End Region

#Region "Private Members"

#End Region

#Region "Events"

	Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
		try
			'This Control primarily loads the appropriate List template 
			'most of the work is done in ArticleListBase.ascx.vb
			'It also holds the Search controls to simplify the templates
			pnlSearch.Visible = CType(Settings("ShowSearch"), boolean)

			If Request("SearchTerm") <> "" Then
				lblSearchResults.Text = Localization.GetString("SearchResults.Text", LocalResourceFile) & " '" & Request("SearchTerm") & "':<br/>"
				lblSearchResults.Visible = True
			End If
			
			Dim controlPath As String = "~/DesktopModules/Articles/"
			Dim listPage As String = Settings("Template")
			
			if listPage = "" then listPage = "ArticleList_Standard.ascx"
			controlPath += listPage
			
			'TODO: verify file exists and handle that error separately
			lstArticles = LoadControl(controlPath)
			If lstArticles Is Nothing Then Throw New Exception("Unable to load control.")
		
			lstArticles.ModuleConfiguration = me.ModuleConfiguration
			objPlaceholder.Controls.Add(lstArticles)
			
		Catch exc as Exception
			ProcessModuleLoadException("Error Loading the Article List:", me, exc, true)
		End Try

	End Sub

	Private Sub cmdSearch_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdSearch.Click
		Response.Redirect(NavigateUrl(TabID, "", "mid=" & ModuleID, "SearchTerm=" & txtSearch.Text))
	End Sub

#End Region


#Region "Optional Interfaces"

        Public ReadOnly Property ModuleActions() As Entities.Modules.Actions.ModuleActionCollection Implements Entities.Modules.IActionable.ModuleActions
            Get
               Dim Actions As New Entities.Modules.Actions.ModuleActionCollection
					Actions.Add(GetNextActionID, Localization.GetString(Entities.Modules.Actions.ModuleActionType.AddContent, LocalResourceFile), Entities.Modules.Actions.ModuleActionType.AddContent, "", "", EditUrl(), False, DotNetNuke.Security.SecurityAccessLevel.Edit, True, False)
               Return Actions
            End Get
        End Property

        Public Function ExportModule(ByVal ModuleID As Integer) As String Implements Entities.Modules.IPortable.ExportModule
            ' included as a stub only so that the core knows this module Implements Entities.Modules.IPortable
        End Function

        Public Sub ImportModule(ByVal ModuleID As Integer, ByVal Content As String, ByVal Version As String, ByVal UserID As Integer) Implements Entities.Modules.IPortable.ImportModule
            ' included as a stub only so that the core knows this module Implements Entities.Modules.IPortable
        End Sub

        Public Function GetSearchItems(ByVal ModInfo As Entities.Modules.ModuleInfo) As Services.Search.SearchItemInfoCollection Implements Entities.Modules.ISearchable.GetSearchItems
            ' included as a stub only so that the core knows this module Implements Entities.Modules.ISearchable
        End Function

#End Region

#Region "Web Form Designer Generated Code"

	'This call is required by the Web Form Designer.
	<System.Diagnostics.DebuggerStepThrough()> 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

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -