C# & VB.NET Coding Standards Guides

Clint Edmonson has released a some free C# and VB.NET Coding standards guides to the community to use.  For anyone who wants to download them they can be downloaded below

C# & VB.NET Coding Standards Guides

kick it on DotNetKicks.com

Posted on 12/27/2008 4:47:52 AM by admin

Permalink | Comments (0) | Post RSSRSS comment feed |

Categories: C# | VB.NET | Visual Studio | Programming

Tags: , , ,

Remove Display Name from Registration in DotNetNuke

Having worked with DotNetNuke since Version 1.0 and before I have seen many changes within the framework.  One of the changes that I liked but found it to be repetitive was when working with the registration tools, we had this field called Display Name that was always asking for input in the form.

DispName1

This image shows the display name as a required field.  I understand the need for this as we want to display a user’s preferred name to them when they login, but it is also nice being able to set this to our own predetermined fields as well. Well this can be done within the framework, with the added bonus that the display name will now not be part of the registration process. 

To accomplish this, lets walk through the process.

Remove the display Name

  1. Login to the portal as an administrator
  2. Go to Admin –> User Accounts
  3. Click on User Settings either at the bottom of the module or in the drop down menu for the module.
  4. Locate the Display Name Format field near the bottom of the user settings
    DispName2
  5. Place the following within the textbox [FIRSTNAME] [LASTNAME]. This will set the display name to the first and last name of the user that is registering.
  6. Click the update button at the bottom of the module.
  7. Log out of the portal as administrator and then click on the registration link. The Display Name field should now not be visible in your registration form.
    DispName3

This makes for a consistent naming scheme for wherever the Display Name field is used within your portal as well as allowing the field not to be required during registration when having new users register.

If you have any comments or other suggestions about tips you would like to see about DotNetNuke please leave them in the comments below.

kick it on DotNetKicks.com

Posted on 10/18/2008 4:59:26 PM by admin

Permalink | Comments (0) | Post RSSRSS comment feed |

Categories: DotNetNuke | Programming | Software

Tags: , ,

New Style Skin Object in DotNetNuke 4.9.0

With the release of the latest version of DotNetNuke 4.9, there have been some new improvements to things.  Some of these things won’t be apparent unless your paying close attention.  This post will not summarize the changes as I made a post previous to this that eluded to the changes.  This post will center around the new Styles skin object.

Style Skin Object

This skin object is new and allows us as skin developers to make better use of the styles that we use with our skins.  We can now use conditional expressions to insert other style sheets within our skin.  This makes it much easier to build a skin and then tweak it for the different types of browsers that may be viewing the site.

Style Object Properties

  • Condition
    • This is an Internet Explorer specific condition.  All valid conditional expressions may be used such as “LT IE 7” or “(IE6) | (IE7)”. More information on these and other Internet Explorer conditions can be found at the MSDN Library.
  • IsFirst
    • This Boolean property allows us to define if the style sheet link should be loaded as the first link or not. If the value is false then it will be loaded as the last link.
    • Values: True, False
  • Name
    • This is a string value that will define the ID of the style sheet link.
  • StyleSheet
    • This is a string value that will contain the path to the  style sheet that is to be loaded. This path is relative to the root of the application.
  • UseSkinPath
    • This Boolean property allows to determine whether we should be loading the style sheet relative to the path of the skin.
    • Values: True, False

As we can see from the properties of the style object, it now gives us many options in how we want to structure our CSS files and even the ability to determine the loading order somewhat of how DotNetNuke places them in the loading order. 

Example

With this new object it always helps to see how to implement it properly.  With that in mind we will explore the sample that is readily available for everyone in the new 4.9 release with the new Entropy skin that replaces the old standby Blue skin.

First up will be how this is implemented in the ASCX files for skin development.

ASCX Method

  1: <%@ Control Language="vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" %>
  2: <%@ Register TagPrefix="dnn" TagName="STYLES" Src="~/Admin/Skins/Styles.ascx" %>
  3: 
  4: <dnn:STYLES runat="server" ID="StylesIE6" Name="IE6Minus" 
  5:     StyleSheet="ie6skin.css" Condition="LT IE 7" UseSkinPath="true" />

As we can see from the example we have a style sheet that will be added to the skin if the browser being used is less than Internet Explorer 7.  The link will be named “IE6Minus” and that we want to load the style sheet “ie6skin.css” from the root of the skin folder because we have the “UseSkinPath” set to true.

HTML/XML Method

  1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2:     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3: <html xmlns="http://www.w3.org/1999/xhtml">
  4: <head>
  5:     <link rel="stylesheet" type="text/css" href="skin.css" />
  6: </head>
  7: <body>
  8:     [STYLES]
  9: </body>
 10: </html>

The content of the html file.

  1: <Objects>
  2:     <Object>
  3:         <Token>[STYLES]</Token>
  4:         <Settings>
  5:             <Setting>
  6:                 <Name>Name</Name>
  7:                 <Value>IE6Minus</Value>
  8:             </Setting>
  9:             <Setting>
 10:                 <Name>StyleSheet</Name>
 11:                 <Value>ie6skin.css</Value>
 12:             </Setting>
 13:             <Setting>
 14:                 <Name>Condition</Name>
 15:                 <Value>LT IE 7</Value>
 16:             </Setting>
 17:             <Setting>
 18:                 <Name>UseSkinPath</Name>
 19:                 <Value>True</Value>
 20:             </Setting>
 21:         </Settings>
 22:     </Object>
 23: </Objects>

The content of the xml file.

Both examples will produce the same output when used in a skin.  They would load the ie6skin.css if the page determines that we are viewing this on a browser that is lower then Internet Explorer 7.  I think in the long run this skin object will be a great addition to the core skin objects that are contained within the DNN Framework.

kick it on DotNetKicks.com

Posted on 10/17/2008 5:47:14 PM by admin

Permalink | Comments (2) | Post RSSRSS comment feed |

Categories: DotNetNuke | Programming

Tags: , ,

Converting HTML Hex Color Codes to RGB in ASP.NET

This is another post for my own remembrance. While working with controls in ASP.NET most of the back colors use the RGB color references instead of allowing you to quickly plug in the Hexadecimal numbers to the control.  At first glance this looks to be a daunting task as there doesn’t appear to be a quick solution for this within the Color class in either VB.NET or C#. But the solution is pretty simple

VB.NET Example

  1: MyControl.BackColor = ColorTranslator.FromHtml("#FFFFFF")

C# Example

  1: MyControl.BackColor = ColorTranslator.FromHtml("#FFFFFF");

It actually becomes pretty easy after you find it.  There are some pretty elegant solutions to this problem on the NET but a lot of them don’t take advantage to what Microsoft has already built into the .NET Framework.

Technorati Tags: ,,,

Posted on 9/24/2008 9:03:25 AM by admin

Permalink | Comments (0) | Post RSSRSS comment feed |

Categories: ASP.NET | C# | Programming | VB.NET

Tags: , , ,

VB.NET Equivalent of C# typeof()

I’ve been slowly adding things that I run across that I need to remember to my blog so that I can find them at a later time. As well as allowing other people with the same issue to find a solution for themselves.

  1: typeof(Widget)

is the equivalent in VB.NET of

  1: GetType(Widget)

Now the next time I start looking for this I’ll have it on the blog and easily searchable.

del.icio.us Tags: ,,

Technorati Tags: ,,

kick it on DotNetKicks.com

Posted on 9/24/2008 8:19:36 AM by admin

Permalink | Comments (0) | Post RSSRSS comment feed |

Categories: C# | Programming | VB.NET

Tags: , ,

DotNetNuke has released NewsFeeds 04.00.00

The latest release of the News Feeds module has made it through the project release cycle.  Peter Donker made the announcement on 8/24/2008.  He has chosen to completely rewrite the module to provide us in the Community with some very interesting options moving forward with this module.

The first one is Aggregation

The module uses a new version of the RSS Toolkit located at CodePlex.  This toolkit allows the module to aggregate feeds of different types together as one feed.

The next one is Caching

They have made some very interesting choices in how they cache the rss feeds for use within the module.  They now store information on disk in the form of the aggregated feed as an xml document as well as storing information in a SQL table with when the feed needs to be refreshed and other information.

The next was Transformation

Previously the XML/XSL transformation was handled by the standard ASP.NET XML component. Now this module uses the same mechanism as the XML module and allows for parameters to be passed to the XSL style sheet.

The next was Displaying

In older versions the news feed module did not display till it had successfully downloaded all the content to display.  This new version uses AJAX to allow for quicker loading of the page and better management of the experience for the end user.

The last note is on Security

If you turn on caching of the module and you use an internal page to display a feed. It is important to remember that the feed that is cached will display the information for the user that was logged in when the feed was first called, so if that user has higher privileges then you want to display information for that may inadvertently get cached.

More reading

Peter Donker’s Blog post

News Feed Download

News Feed Discussion Forum


del.icio.us Tags: ,,

kick it on DotNetKicks.com

Posted on 8/25/2008 7:20:12 AM by admin

Permalink | Comments (0) | Post RSSRSS comment feed |

Categories: Software | Programming | DotNetNuke

Tags: , ,

Lost your DotNetNuke Password

Hector Sosa of SystemWidgets has released a Windows Winform application that allows you to modify the User database in DotNetNuke. I’ve checked out the screen shots and it looks interesting and useful.  There is a download for the binary files as well as the source of the application.  More information can be found at his blog.

Hector Sosa Blog

del.icio.us Tags: ,,

kick it on DotNetKicks.com

Posted on 8/22/2008 5:21:16 AM by admin

Permalink | Comments (0) | Post RSSRSS comment feed |

Categories: DotNetNuke | Programming | Software

Tags: , ,

Compilation Error: ‘Title’ is not a member

I was brought in to work on an asp.net web site recently that had been written by another company.  I was asked to add some features to their current site as well as to fix some bugs that had been left by the previous developers.  Once I had the site ready I moved this web site project to my staging server and then started receiving this error on a couple of pages.  Now I had chosen to publish the website instead of just doing a copy of the site with the code-behind files as well.  This is when this problem started.

I did some searching on the web and came up with the following that the class I had on these pages were duplicates on other pages or other compiled dlls within the published site.  So I started looking for the pages that had the offending classes and I discovered them within the web site.  I wish I had the time to move this web site into a web application project to avoid these issues.  More information can be found here as well.

del.icio.us Tags: ,

Technorati Tags: ,

kick it on DotNetKicks.com

Posted on 8/5/2008 5:28:07 PM by admin

Permalink | Comments (0) | Post RSSRSS comment feed |

Categories: ASP.NET | Programming

Tags: ,

New DotNetNuke Developers Help File

For developers new to programming modules within DNN there is a new tool available at codeplex. Ernst Peter Tamminga has spent several hours documenting the DotNetNuke core routines within the framework. The help files are generated using SandCastle and the SandCastle Help File Builder using the unmodified sources from DotNetNuke.

If you want to browse the help:
- Unzip DNNHelpSystem_CHM.zip into 1 .chm Help File to a local disk folder
- Double click the extracted .chm file.
- Now you can browse all help items MSDN style

The following is available for download:

Files

Documentation MSDN Style help file

documentation, 9947K

Documentation Readme

documentation, 3K

Source Code SFHB project

source code, 3K

Documentation Intellisense

documentation, 216K


kick it on DotNetKicks.com

Posted on 7/24/2008 4:52:06 AM by admin

Permalink | Comments (0) | Post RSSRSS comment feed |

Categories: DotNetNuke | Programming | Software | Visual Studio

Tags: , , ,

Introducing Waegis : Keyvan Nayyeri

Interesting note for Blogengine.net developers who are looking for some alternate extension ideas. There is a new spam filtering service that is currently being placed out there in the wild in alpha format. This is written entirely in .NET and should be something worth looking at in the next couple of months to see if he can carry through with his ambitious plans for this new service.

Introducing Waegis

del.icio.us Tags: ,,

kick it on DotNetKicks.com

Posted on 5/13/2008 6:01:00 AM by admin

Permalink | Comments (0) | Post RSSRSS comment feed |

Categories: ASP.NET | BlogEngine.NET | Programming

Tags: , ,