Saturday, July 31, 2010
  Search
 
Register
Login
 
Customize Google Analytics for DotNetNuke Search
You can easily set up your Google Analytics account to track the search feature on your DotNetNuke website and take advantage of all the in depth reporting that Google has to offer. It's simple, here...

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 . . .

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 . . .

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 . . .

Installation from the DotNetNuke Install Package 4.90 to Windows XP Professional
OK, so you made the leap and downloaded an installation package of DotNetNuke 4.x.   But now what do I do?  Well, here's a step-by-step instruction guide to get you up and running with DotNetNuke 4....

Find this article and more in the Localhost category

Read This Article . . .

New DotNetNuke 5.0 Cambrian Package Writer for Module Developers
Attention developers! DotNetNuke 5.0 Cambrian has a nifty new tool to help developers package their modules nicely to fit with the new “Extensions” manager. Under the old Module Definitions manager, ...

Find this article and more in the category

Read This Article . . .

Everything You Never Wanted to Know About the Config File
This is the "pre-" first installment in a series that will cover the parts of the web.config file to give you an idea of how to manipulate and customize your DotNetNuke portal. The web.config fi...

Find this article and more in the category

Read This Article . . .

Fixing IE's Hover Problems in DNN
 So you have designed a great skin, skin object or module for DNN and it uses the :hover attribute and looks fantastic in Firefox. Now, you find out that nothing works in IE because IE doesn't suppor...

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 . . .

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 . . .

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