Thursday, September 09, 2010
  Search
 
Register
Login
 
Creating new DotNetNuke HTTP Alias Records
 Setting up DotNetNuke to handle serving requests for Portal Alias records is a breeze. You can use these records to direct your site to handle requests for multiple domain names to one website with ...

Find this article and more in the category

Read This Article . . .

Quick Look at Some New Features of DotNetNuke 5 Cambrian
DotNetNuke’s much anticipated Cambrian has finally been made available as a Release Candidate and while it looks like the same ol’ packages from afar, it’s packed with some nice new features that are...

Find this article and more in the category

Read This Article . . .

Getting Aquainted with the DNN Classes
 So, you've decided to start checking out DotNetNuke development and you're wondering where to start, right? Well, it's easy to start taking a quick tour of the DotNetNuke classes now with the help o...

Find this article and more in the category

Read This Article . . .

Quick Check for Troubleshooting the CodeEndeavor Ajax Templates
I haven’t just installed the the template and created a module out of the box yet. However, I have come across a few things that I know to check and fix and I’m up and running in no time at all. If y...

Find this article and more in the category

Read This Article . . .

Installing DotNetNuke on the root of GoDaddy - 8 Simple Steps
If you have are having a hard time getting DotNetNuke installed on the root of your hosting account, read this article to find out how. This article was originally written for a the specific purpose ...

Find this article and more in the Hosting Provider category

Read This Article . . .

Adding Google AdSense with Video
Adding Google AdSense to your DotNetNuke portal has never been easier. By default, a Google AdSense module is added the list of installed modules when your DNN portal is first created. It's easy to ...

Find this article and more in the Modules category

Read This Article . . .

How To Customize the Privacy and Terms Links on Your DotNetNuke Portal
Straight out of the box, DotNetNuke already has a lot of things covered. But, what do you do when you are ready to begin customizing your site. Sometimes, it’s not so easy to figure out how to make t...

Find this article and more in the category

Read This Article . . .

More Ways to Install DotNetNuke Modules with the URL Method
While DotNetNuke has a built in mechanism for installing modules, there is another method you can use as well. This is a great alternative to use especially when you are trying to install larger mod...

Find this article and more in the category

Read This Article . . .

How to Install and Configure ActiveDirectory Provider for DotNetNuke 5.0
 The directions for installing and configuring extensions in DotNetNuke 5.0 are very similiar, but slightly different than from previous versions. Here's how to install the ActiveDirectory authentica...

Find this article and more in the category

Read This Article . . .

Simple Intro to the DNN UserInfo Class
 New DNN developers often wonder how to expose information about logged in users to a custom DotNetNuke module. So, I threw together a very simple example to show how easy it is to begin using the bu...

Find this article and more in the DotNetNuke category

Read This Article . . .

Recently Added Articles

Minimize
Article List

 

How to Use the DNNLabelEdit Control

11/21/2008 12:15:25 AM - By Briana Tarrance

Category: Module Development | | Comments 0

 

 

Related Links

It's easy to use the DNNLabelEdit control, you know the one you mouse over and edit in place? Yeah, that one. In just a few minutes, you can begin using the control on your sites as well for full on the spot editing. Here's how:

 

Register the control

 

<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.UI.WebControls" Assembly="DotNetNuke" %>

 

 Apply Control to the Page

 

  <dnn:DNNLabelEdit ID="lblContent" runat="server" LostFocusSave="False"  ToolBarId="tbEIPHTML" MouseOverCssClass="LabelEditOverClassML"

RenderAsDiv="True" LabelEditCssClass="LabelEditTextClass" EnableViewState="False" Text="Click To Edit" />

 

 *You don't have to use all of the properties, and there are actually many more than what is shown here.

   

Hook Up Your Update Method

   

Select the control and right click or hit F4 to get the properties in Visual Studio. Click on the lightning bolt to get to the methods. Type a name for your new update method and add it to the "UpdateLabel" field. Once you have entered the new name for the method, you will be sent to the code behind and will see the outline of the update method. From here you can add whatever logic you need. Basically, you can access the updated text with "e.Text.ToString" from within the newly create procedure, as seen below

   

Persisting the Update to a Database

   

Protected Sub AddNewCategory(ByVal source As Object, ByVal e As DotNetNuke.UI.WebControls.DNNLabelEditEventArgs) Handles lblContent.UpdateLabel

   

'create the object

Dim catInfo As New CategoriesInfo

   

'get the current user info

Dim user As UserInfo = UserController.GetCurrentUserInfo

   

'fill the object and

'assign the new text to the categoryName value

catInfo.CategoryName = e.Text.ToString

catInfo.CreatedBy = user.DisplayName

catInfo.CreatedOn = Date.Today

   

'update the catInfo object & persist to database

CatController.Create(catInfo)

   

End Sub

   

powered by metaPost

 

 


 
 
Copyright 2008 by Virtual-Essentials.com Privacy Statement    Terms Of Use