DNN module development series (6) -- General controls in DNN (bottom)

Source: Internet
Author: User
Tags dnn

TextEditor:

Introduction:
Rich Text Editor controls. You don't need to talk about the functions. DNN uses the Providers mode to easily integrate multiple Rich Text editors. I know FreeTextBox, FCKEditor, WebHtmlEditor, and CuteEditor. You can easily select one type by configuring web. config. The specific configuration method should be detailed in every rich text editor Providers.
Location:Controls \ TextEditor. ascx
Attribute:
ChooseMode: enables/disables switching between a general text editor and a rich text editor. The default mode is enabled.
ChooseRender: determines whether to enable the Text Content Rendering mode in general text editor mode. The default setting is enable
DefaultMode: the Default Editor mode. The default mode is RICH text ("RICH" or "BASIC ")
HtmlEncode: whether to encode the content in HTML (that is, escape some characters, such as: "<", ">", etc)
Mode: The current editor Mode, whether it is RICH text or general Mode ("RICH" or "BASIC ")
Text: control Text content
Height: control Height
Width: control Width
TextRenderMode: sets the Text rendering mode {Raw | HTML | Text} In general Text editor mode}
Raw: it is a natural way to display the original text.
HTML: convert text format to HTML format (that is, replace all carriage returns with "" And line breaks with "<br/>)
Text: convert HTML format to Text format (replace all blank characters, such as tabs, and replace all <br> labels with line breaks)
RichText: Rich Text Editor Provider

Usage:
1. register the control on the page to be applied, for example:
<% @ Register TagPrefix = "dnn" TagName = "TextEditor" Src = "~ /Controls/TextEditor. ascx "%>

2. Write the following code as needed, for example:

<Dnn: texteditor id = "teContent" runat = "server" height = "400" width = "500"> </dnn: texteditor>

3. Declare and use the control in the background code

Protected WithEvents teContent As TextEditor

TeContent. Text = objArticle. Content
ObjArticle. Content = teContent. Text

Note: To display rich text content, use Server. HtmlDecode () for decoding.

Available Rich Text editors:
Let DNN also use CuteEditor
Another useful FCKEditor in DNN
LionHtmlEditorProvider (v1.0.3)

UrlControl

Introduction:
Url Selection control. You can select a webpage (Tab) inside a website, select an internal website file, or enter the Url of an external website. In the file selection mode, this control also provides the file upload function (you need to set permissions for users in the file management system ). This control can also be used with URLTrackingControl to set whether to record link clicks.
Location:Controls \ UrlControl. ascx
Attribute:
FileFilter: file type. You can select and upload types, such as jpg, gif, and txt.
LocalResourceFile: Language Resource file corresponding to the control. You do not need to set this parameter. The default value is enough.
Log: Obtain and set whether to record click logs for the link. And records the detailed access time of the visitor.
ModuleID: Set the module to which the link belongs. No special settings are required. This control obtains the ID of the current module by default.
NewWindow: gets and sets whether the link is opened in a new window.
Required: Obtain and set whether the link is Required. Default Value: True
ShowDatabase: whether to display files stored in the database. Default Value: True
ShowFiles: shows whether to add a file. Default Value: True
ShowLog: whether to display the log selection. Default Value: True
ShowNewWindow: whether to display new window opening link selection. Default Value: False
ShowNone: whether to display none. Default Value: False.
ShowSecure: whether to display files stored in the file system. Default Value: True
ShowTabs: whether to display the internal page selection of the website. Default Value: True
ShowTrack: whether to display the set record link clicks. Default Value: True
ShowUpLoad: whether to display the file upload. Default Value: True
ShowUrls: whether to display the default value: True
ShowUsers: shows whether to add a link to view user information. Default Value: False
Track: gets and sets whether to record the number of clicks of a link.
Url: Get and set the link value
UrlType: Get and set the current link type. N: none; U: External link; T: internal link; F: File Link; M: User Information Link
Width: the Width of the control.

Usage:
1. register the control on the page to be applied, for example:
<% @ Register TagPrefix = "Portal" TagName = "URL" Src = "~ /Controls/URLControl. ascx "%>

2. Write the following code as needed, for example:

<Portal: url id = "ctlURL" runat = "server" width = "250" shownewwindow = "True" showusers = "True"/>

3. Declare and use the control in the background code

'Declare The Link Control.
Protected WithEvents ctlURL As UI. UserControls. UrlControl

'Set the access Link
CtlURL. Url = objLink. Url
ObjLink. Url = ctlURL. Url

'Record the trace settings of the Link (only link tracing with a Write statement will take effect)
'Dnn uses the UrlTracking table to record link settings. UrlController is a class provided by the framework.
Dim objUrls As New UrlController
ObjUrls. UpdateUrl (PortalId, ctlURL. Url, ctlURL. UrlType, ctlURL. Log, ctlURL. Track, ModuleId, ctlURL. NewWindow)

4. If you want to use the trace settings of the link, you still need to do some processing on the display link. For details, refer to the practices of the Links module.

URLTrackingControl

Introduction:
The link click condition tracking display control. Displays the number of clicks, click Time, and user details of a link.
Location:Controls \ URLTrackingControl. ascx
Attribute:
FormattedURL: sets formatted links. If this parameter is not set, the system automatically formats the link to be tracked.
LocalResourceFile: Language Resource file corresponding to the control. You do not need to set this parameter. The default value is enough.
ModuleID: Set the Link Tracking status of the module to be displayed.
TrackingURL: obtains the link for accessing a trail. Only access in this way can achieve the tracking effect.
URL: the link to be tracked.

Usage:
1. register the control on the page to be applied, for example:
<% @ Register TagPrefix = "Portal" TagName = "Tracking" Src = "~ /Controls/URLTrackingControl. ascx "%>

2. Write the following code as needed, for example:

<Portal: tracking id = "ctlTracking" runat = "server"/>

3. Declare and use the control in the background code

Protected WithEvents ctlTracking As UI. UserControls. URLTrackingControl

CtlTracking. URL = objLink. Url 'tracked Link
CtlTracking. ModuleID = ModuleId

Finally, we will introduce the preparations before the module development. The next article will introduce some related knowledge and development skills in the module development process. In the article "DNN module development series (7)-coding with CodeSmith Templates", let everyone experience the development of the DNN module!

Series Article Navigation:
DNN module development series (1) -- Analysis and Design
DNN module development series (2) -- Build a module development project
DNN module development series (3) -- add module definitions in DNN
DNN module development series (4)-classes related to module development
DNN module development series (5) -- General controls in DNN (I)
DNN module development series (6) -- General controls in DNN (II)

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.