DNN Blog

Jun 3

Posted by: Chris Hammond
6/3/2010 3:53 PM  RssIcon

UPDATE 11/23/2010:  I've released a new version of these templates that no longer uses the NANT Build scripts, they now use MSBuild. For more info check out  this blog post

UPDATE 8/21/2010: I have now released a Visual Basic template, you can use either the C# or VB.net template, with the instructions below. The VB template is available on the same page as the C# version, you will need to change the path of the template location for the VB version.

Two days ago I posted a blog about configuring a DotNetNuke development environment, in preparation for today’s blog post about a C# module development template that I recently released on Codeplex. So today’s blog post is about how to utilize the template, customizing the VSTemplate file to fit your needs with company name, namespace, email, and URL. Installing the template, and then creating a quick and easy module using the template.

  1. Configuring your development environment
  2. This post
  3. Configuring NAnt to package your DotNetNuke Modules

If you haven’t read my post about setting up your development environment I encourage you to do so before proceeding, as the steps I’m going to walk you through below assume you are running a similar environment to me. The following assumes you are using DotNetNuke V5+ and Visual Studio 2008, if you are using an older version of DNN and Visual Studio there are no guarantees that this template will do anything for you except cause pain. It’s time to upgrade folks! DNN 5 rocks!

Ideas behind this template and projects using the template

The Visual Studio Template discussed in this blog post is designed using the WAP model, web application project. This means that your module will be compiled into it’s own DLL, with a simple reference to the DotNetNuke DLL(s). You do not open up the source code of DNN, there is no need, you can easily debug your module, package your module, and deploy your module using this template and the methods discussed in this and the other blog posts in this series. There are other ways to do DNN module development, and other tutorials on how to do module development, but this is the method I choose to use in my own development, and the one I show to people when they are having problems getting their head around module development in DNN.

Intro to Visual Studio Templates

If you’ve never use a visual studio template in your development in the IDE you are missing out! Custom templates are a great way to get specific project types up and running quickly. Installation of these templates is easy, and if you feel like digging into them further than we are going to do in this blog, you can really create some cool templates. The template we are discussing today can be found at http://christoctemplate.codeplex.com, in a later section I’ll actually talk about downloading and using the files, but for now I’ll provide an overview of why the template exists and what it provides.

After many years of module development I’ve come up with my preferred ways of doing things, often times because of struggles along the way, and other times just to make things faster. The template I’ve put together includes a basic shell for creating a DNN module, you get three different User Controls (ASCX files) one for View, one for Edit and one for Settings. These user controls inherit from specific base classes, which themselves inherit from base classes that DotNetNuke itself provides for modules to use, PortalModuleBase and ModuleSettingsBase. In addition to the ASCX files there are Localization files, .RESX files in the app_localresources directory that DNN will utilize for localizing strings within your module.

By utilizing this template in your C# Module development you can easily get a project up, compiling and even packaged (packaging with NANT will be discussed in a blog post later this week) within seconds. With a few minor changes to the project file you can easily get your module running within your DotNetNuke website and debugable. There are some additional files within the template for the Manifest information for DNN, a BUILD script for packaging with NANT, and even a stub’d module.css file. The module that gets created with this package doesn’t have any functionality in terms of displaying information or interacting with the user controls, it wasn’t intended to provide functionality out of the box, but it does provide a great launching point for starting your development for DNN.

Downloading the Visual Studio Template

Downloading and using the template is fairly straight forward, you can go to the project page at http://christoctemplate.codeplex.com/, click on the releases link on the side of the page and you can download the template, it comes as a ZIP file. Now, before we go about installing the template, I will talk about customizing the template for those of you who are interested in doing so.

Customizing the Visual Studio Template

Templates are really pretty easy to customize, and I’ve tried to make this one easier than normal with the instructions here. Out of the box this template will create a module with the namespace of com.christoc.dnn.PROJECTNAME, an email address of modules@christoc.com, website of http://www.christoc.com/ and a company name of Christoc.com. When you create a project all of this information will be spread throughout the files for that project. So rather than you going out and spreading christoc.com love around you can modify these four settings prior to installing the template. When you download the template from http://christoctemplate.codeplex.com/ you get a ZIP file, that ZIP file is actually what you are going to use in Visual Studio, you don’t need to extract the contents of the file.

To customize the template though you do need to open this ZIP file up, the file you are going to customize is “Christoc.com C# Compiled Module.vstemplate”. I recommend extracting the contents of the ZIP file somewhere on your local computer. Once you extract the contents of the ZIP package navigate to the folder where the extracted files exist and open the VSTEMPLATE file in NotePad or some other text editor. If you open up this file you will see some comments in the 27 lines of the file, the comments are wrapped with these comments point out locations in the VSTEMPLATE file that you can customize to match your company name, email, url, and name spaces. I’ve highlighted those fields in the screenshot here

image

Customization is as easy as modifying that file, saving the changes, and then repackaging the ZIP file. Repackaging the ZIP file is up to you, but I prefer to press Control-A in the folder where all the extracted files are, right click on the VSTEMPLATE file and choose Send to Compressed (zipped) Folder, if you right clicked on the VSTEMPLATE file the ZIP file will be called “Christoc.com C# Compiled Module.ZIP”, you can also change the file name before creating the ZIP file in order to give it a different name. Now that you have a new ZIP file with your custom changes you can proceed on to the next step in the process, installing the template.

Installing the DotNetNuke C# Module Visual Studio Template

Installing the Visual Studio Template is fairly straight forward. You should close all instances of VS2008, then copy the ZIP file, either the one you downloaded from Codeplex, or the one you customized in the previous steps. You are going to paste this ZIP file into a very specific folder. Visual Studio Templates by default are stored in your My Documents\Visual Studio 2008\Templates folder. Within that folder you should go into ProjectTemplates\Visual C#\Web folder. If you don’t have a WEB folder within the Visual C# folder you can simply create a new folder.

Here’s a screenshot of my web folder with the template installed.

image

Notice that the path for this location is highlighted in yellow. It was that simple, you now have the visual studio template installed and ready for you to use.

Creating A Project with the Template

Because you closed all instances of Visual Studio 2008 prior to installing the template you can now open VS2008, when Visual Studio opens it loads all the templates from the templates folder. If you happened to leave VS2008 open before installing the template the IDE doesn’t know about this new template so you need to open up a new instance of VS2008.

Now that you have Visual Studio open you should click on File>New>Project. In the new project window Navigate to your Visual C#/Web folder under project types, after doing so you should see something like the following.

image

In that window be sure to choose the new template that you installed, in my case I’m going to access Christoc.com C# Compiled Module. From there I can populate the project properties below. In the screenshow below I’ve populated the key project properties.

image

The NAME of our project is going to be important going forward, whatever you type in for Name will become the project name, the name of the DLL and part of the namespaces for your project. You can always change the name later, but you’ll have to change it in a large number of places, so I suggest you name your project carefully. In my example here I’m calling the module ModuleName2, not an idea naming convention, but for example purposes it will suffice.

The LOCATION of our project is also very important, notice in the screenshot I placed the project in c:\websites\dnndev\desktopmodules\ DNNDEV is my development environment that I configured in the previous blog post (you read that one right?). So we are creating our project within the DotNetNuke environment, this will aid in our development and debugging for the module, there is no need to move files from one folder to another to start using our module in our development install of DNN. The Project that will be created based on this template requires that you put your project into the website/desktopmodules folder, if you put it elsewhere when you compile the module the DLL will be placed into the website/bin folder, in my case into c:\websites\dnndev\bin\.

The other option you should make sure you follow, uncheck the “Create directory for solution” checkbox on the project creation screen. This will prevent Visual Studio from creating our project inside of c:\websites\dnndev\desktopmodules\ModuleName2\ModuleName2, we want the project and solution files to reside in c:\websites\dnndev\desktopmodules\ModuleName2, not within a sub folder of that folder.

Once you have configured the New Project window click OK and Visual Studio will create the project and all the associated files based on the template for you.

Final Project Configuration and Compilation

After creating your project, inside of Visual Studio you will see a window appear that will display a list of instructions for you

image

Here is what you need to do. Right click on the Project in your Solution Explorer, and choose Properties. From the Project Properties window we want to go to the Web tab.

image

In the Web tab we need to configure a couple of settings. For our Start URL we are going to use http://dnndev/ (the URL we created in our environment configuration blog yesterday)

image

We then need to configure the Use Local Web Server option, the Project URL is http://dnndev/desktopmodules/ModuleName2 and the Override application URL setting should be http://dnndev/

image

Once you have modified these settings you can save your project and close the project properties window. Now you can compile! Being a keyboard junky I would suggest using Control-Shift-B, this will do a build of your project, and if you haven’t broken anything the build should compile successfully. The process of building the module compiles the code into a DLL and places that DLL into the c:\websites\dnndev\bin folder with the name of ModuleName2.dll

The next blog post in this series will cover the automated packaging process using NANT and getting the module installed into your DotNetNuke instance.

If you have any feedback on the template please let me know. Check it out on Codeplex and add a rating if you like it!

UPDATE 11/23/2010:  I've released a new version of these templates that no longer uses the NANT Build scripts, they now use MSBuild. For more info check out  this blog post

41 comment(s) so far...


Gravatar

Re: Using and Customizing a C# Module Development Template

1. Will your template support/include Control Methods ?
2. Will it support new SilverLight ?
3. Does it use DAL+ ?


By Jaydeep Bhatt on   6/7/2010 9:49 AM
Gravatar

Re: Using and Customizing a C# Module Development Template

1) I am not sure what you are asking here?

2) Sure it will support silverlight if you convert it to VS2010 and include all the silverlight references. It doesn't out of the box have any references for any of that.

3) No, it doesn't have any real database actions right now, but it is setup for the standard dataprovider model DNN uses.

By Chris Hammond on   6/7/2010 9:50 AM
Gravatar

Re: Using and Customizing a C# Module Development Template

A quick test in Visual Studio 2010 appears to validate that this C# Module Template will also work fine (without modifications) in Visual Studio 2010

By Chris Hammond on   6/9/2010 8:43 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

Thanks! Up and running in no time!

By thomas261087 on   6/10/2010 12:02 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

Chris,
Thanks for providing this Template and the direction. It came along at a time I really needed it for my beginning C# DNN module development. If you have any C# samples using this (or similar) module template; I would be eager to see them. You can even privately get my email and send me some. This will help me a lot to envision your intended usage.
Paul

By Paul Johnson on   6/23/2010 11:33 AM
Gravatar

Re: Using and Customizing a C# Module Development Template

Paul, I don't currently have any additional samples but I will here in the next few weeks. I'll have a project or two on Codeplex that started with this template.

By Chris Hammond on   6/23/2010 11:33 AM
Gravatar

Re: Using and Customizing a C# Module Development Template

Chris,
Thanks for providing this Template and the direction. It came along at a time I really needed it for my beginning C# DNN module development. If you have any C# samples using this (or similar) module template; I would be eager to see them. You can even privately get my email and send me some. This will help me a lot to envision your intended usage.
Paul

By Paul Johnson on   6/24/2010 12:40 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

Chris, when I follow this instruction, my DNN website no longer allows me to Register or Login. The rest of the pages still show up fine. I got up to the step of building/packing a TestModule1 and see the DLL in C:\Inetpub\wwwroot\DNN\bin folder. When I click on Login (trying to install the module), all I get is a blank screen with a security lock image. Same thing with Register link. I had to manually go and delete the TestModule1 from DesktopModules\TestModule1 and bin dir. One thing I notice is that when I modify the TestModule1 project start option, VS asked me to create a virtual directory. I had to click Yes, otherwise, it says "User Action Cancel" and does not apply the changes you instructed. This step is not in your instruction.

By Kristina Nguyen on   6/24/2010 12:03 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

Kristina, I'm not sure why creating your new module would cause a security issue. What environment are you in? Windows 7? XP? something else?

Any chance you can provide me a little more info and we'll see if we can't get you worked out?

As for the Virtual Directory thing, some configurations prompt for that message, others don't. If it does create a virtual directory make sure your project doesn't also get a web.config file added, that might cause issues.

By Chris Hammond on   6/24/2010 12:39 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

Chris, nice blog series. How (if at all) does this differ from the C# starter kit project?

I followed your directions, but am having some trouble with VS2010 and Windows 7. When I go to set the "use local web server" part, VS2010 won't let me select them, saying that "to access local IIS websites, you must install IIS 6 Metabase and IIS 6 configuration compatibility" It also wants me to run VS as an admin, which we don't need to do to run (and debug) any of our other services.

One wrinkle is that we've host-filed the name local.intranet.ourcompany.com as the alias for the site instead of dnndev (since the site will be intranet.ourcompany.com) - can that make a difference?


Any thoughts?

By Jeff Sullivan on   8/2/2010 5:02 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

Chris,

Te template seems to choke on project names with dots in them (we use a convention of naming our projects similar to our name spacing for organizational purposes). Is this a limitation of the template?

Also, we have a centralized subversion code repository for all projects, so putting the projects inside a DNN file hierarchy is not going to be a popular option. What are the implications of keeping the project folders completely separate in their own hierarchy?

By Jeff Sullivan on   8/2/2010 5:02 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

Jeff, I will have to do some testing with VS2010, my testing so far was limited to just using the template really quick to create a project in my normal dev environment and it worked as I would have expected, though my environment does have the IIS6 configuration as well.

As for the dots in the project name, I will test that out as well. It might very well be a limitation of the template due to namespaces for now, I will have to test.

And for the subversion setup. Putting them outside of DNN is possible, but you will need to customize the build actions to copy all the files into a DNN directory if you want to be able to easily debug your modules inside of a DNN install. The approach I document makes it easy to fire up and debug your code inside of your development environment without having to move code around between directories.

By Chris Hammond on   8/2/2010 5:04 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

FWIW, I checked and the template that Mitch Sellers uses (which is very similar) seems to be okay on dots in the project name, but yours has issues. It does relate to the namespaces in the projects.

The starter kit project shares the same problem, which may make sense if it's based on yours.

By Jeff Sullivan on   8/3/2010 5:26 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

Hey, chris, I misspoke. Mitch's template does have the same problem. It comes from the class name replacement (not namespacing per se). I had modified by templates to avoid this and forgot. You can kill my recent comment about it working.

We'd have to get more fancy with the template replacements if you wanted to permit dots in the module names to carry through.

By Jeff Sullivan on   8/3/2010 5:24 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

Chris, I've been able to use your C# template with great success. I did notice, however, that VS2010 Ultimate adds a web.config file to the project sometimes after a build. I've yet to figure out what triggers this, but if it happens and the users don't catch it, they'll get an exception in DNN complaining about virtual directories not being set up correctly. The simple fix is to delete the web.config file that VS2010 adds to the project. As far as I can tell, VS will only do this once for a project, but it's happened to every project I've created through this template.

Thanks for your work and for sharing your knowledge with the rest of us. I just thought I'd pass this along in case someone else happens to see this behavior and can't figure out what's going on.

-Glenn

By Glenn Wilson on   8/30/2010 2:20 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

Chris, I am getting the following error message in Visual Studio 2008.
Unable to copy th file 'Christoc.com_VB_Compiled_Module1.build' from the project template to the project. Cannot find file "C:\Users\userid\AppData\Local\Temp\1wibejfw.tzx\Temp\Christoc.com_VB_Compiled_Module1.build".

I set everything up just as you suggested. Do you have any ideas? Thanks

By Webtrician on   8/30/2010 2:19 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

Ok, I finally was able to get the VB Template to work. I had to change the IISUrl and IISAppRootUrl as shown below, even though I have dnndev in the hosts file.

localhost/DesktopModules/$safeprojectname$
localhost/

But I did notice that if I include a dash in the name it replaces it with an underscore and fails to find the files. It looks like special characters messes this up. Is there anyway around this? Thanks

By Webtrician on   8/30/2010 2:19 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

Chris,
I am also having the same issue as Kristina.when I follow this instruction, my DNN website no longer allows me to Register or Login. The rest of the pages just shows "sponsor" and everything is blank. When I click on Login (trying to install the module), all I get is a blank screen with a security lock image. Same thing with Register link. any solution to this please

By chaitanya on   10/21/2010 3:14 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

I must be doing something wrong,.. My site is working. But when try to create a project using the VB template (XP, VS2010) it tells me that the URL has not been configured and asks if I want to create a virtual directory now.

If I click yes it tells me that the virutal directory can not be created because it can not find the server iconintranet on the local machine.

Is it an IIS configuration issue? Even though I have changed the HOSTS file I can not access the site by typing iconintranet into the browser. Is this because I am running on XP.

Nothing I can do about it right now. Our MSDN subscription is on backorder (not sure how emailing membership info would create a backorder), after it arrives I could create a virtual machine and run Win7 there for development if I had to, but my machine isn't all that powerfull so I'd rather not if I didn't have to.

Thanks for any help you migth be able to provide!

By Lou Syracuse on   11/5/2010 11:27 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

Maybe its a stupid question but i am not a professional programmer so how can i use settings i made in a resource file.
I set up a variable Called LinkBurronText in my edit.ascx.resx
but when i try to use it either by setting control:
" >
Or programmatically:
linkbutton1.text = GetLocalResourceObject("LinkButtontext").ToString
i get error in DNN site saying that "resource cannot be found"
But when i change default settings in templates resource files - everything works perfectly.
So how can i access values in my resource files from my module?

By the way - thank you very much for your templates - i wasn`t able to figure out how to make default DNN template to wark at all! = )

By JaguarSmith on   11/5/2010 11:26 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

resources can be accessed by calling Localization.GetString("StringName.Text",LocalResourceFile);

you should take the module development training course we go over all of this in that course bit.ly/dnntraininginfo

By Chris Hammond on   11/5/2010 11:27 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

hello
ok i installed it.but tell me how will i develop my module from this solution project.i meant how will i test whenever i add,edit data in ascx and its .cs files? i tried to add it in a dnn page by importing module with the manifest file.but when i add control with click events i get errors.
also i noticed that when i reopen that project from desktopmodule/mymodulefolder i get the following errors - System.Runtime.InterOpServices.comexception and i cant open the project!!!!!!.

please help.

By Mridul Samadder on   11/7/2010 6:13 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

I've created a project based on the C# DotNetNuke Module Development Template you provided. However it doesn't have the *.build file. Would you know why? Am I missing something?

I can't execute NAnt because of this. Thanks.

By Jan Montano on   11/23/2010 10:00 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

Jan, if you're using my latest template (00.00.05 release) I removed NANT in favor of MSBuild. Check out my blog post from last week.

By Chris Hammond on   11/23/2010 10:01 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

Hi, Do you have any SAMPLE CODE or Documentation for using DataProvider.cs in your Template to display the data on View.ascx? I’m trying to populate a GridView and DropDownList with data from the SQL server 2008 database Tables.
Thanks!

By Sam on   2/25/2011 9:08 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

Sam, check out dnnsimplearticle.codeplex.com for example code.

By Chris Hammond on   2/25/2011 9:08 PM
Gravatar

Re: Using and Customizing a C# Module Development Template VB vs C#

Using IIS 7 I created a new project with the VB template I get the error below. I do not get this with the C# template. Is there something with the template or do I need to install the older metabase?


"The Web Application Project TestCrisOritional is configured to use IIS. To access local IIS Web sites, you must install the following IIS components:

IIS 6 Metabase and IIS 6 Configuration Compatibility

In addition, you must run Visual Studio in the context of an administrator account."

Thanks, Matthew

By Matthew Hile on   3/7/2011 2:16 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

Matthew I haven't experienced that before but you likely need to install the IIS6 stuff as well.

By Chris Hammond on   3/7/2011 2:16 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

Hi, (thanks for the template it works great).

In the resulting project I created an images directory (i.e. at the same level as Documentation) into which I placed various images that I intend using in my module (e.g. icons etc.). What changes do I need to make to the template, project or build scripts that will ensure an images folder is created in my packaged module? Currently it seems to place all the images into the (modules) root folder when I install it. (I have code in my module that expects to find images in a folder underneath the root - I could move them but would prefer not to).

Secondly if I create a module with more than one definition do I just edit the MyModule.dnn file to describe the additional definition and will the existing scripts take care of the rest?

By Norman Landing on   5/31/2011 10:52 AM
Gravatar

Re: Using and Customizing a C# Module Development Template

Hi Chris,

Sorry if this has been asked and answered elsewhere, but when developing modules with this template as separate projects, it appears that we can't easily make use of the DNN text editor control by using



Is there a workaround or straightforward way to get the control markup to work in this template?

By Josh on   7/5/2011 1:06 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

Josh for examples of how to use the TextEditor check out dnnsimplearticle.codeplex.com as this module uses the same template.

By Chris Hammond on   7/5/2011 1:07 PM
Gravatar

Re: Using and Customizing a VB Module Development Template

Hi,
I've installed (and customized) the VB template, and when I click File/New Project/ it asks me only the project name not the location and other parameters as in your screen capture. It's the same with the original template (without customizations). Any built in template shows all the options. Why?

By Kristian Radolovic on   8/7/2011 1:33 AM
Gravatar

Re: Using and Customizing a C# Module Development Template

I am using Visual Studo 2008 Pro. I tried to use VB version. It didn't even load the project if I do not use the same site name as dnndev/. So I found the work around by editing "ModuleName.vbproj" using notepad. I changed the UseIIS value to false False. And then managed to load and run the project. But the problem is when I try to debug it gives an error "Unable to start debugging on the server. Web server is not configured correctly. See help for common configuration errors. Running the web page outsite the debugger may provide further information"

Is there a way to debug modules created using this template ?

By Dush Abey on   10/14/2011 10:03 AM
Gravatar

Re: Using and Customizing a C# Module Development Template

Kristian, debugging with this template should work as normal. Perhaps you don't have the debug configuration in your web.config file. That or you aren't following all the directions for setting up your development environment.

By Chris Hammond on   8/7/2011 1:34 AM
Gravatar

Re: Using and Customizing a C# Module Development Template

Chris, I wonder if you can help. I have installed the dev environment and modules following your instructions. They both load and compile and I can make edits rebuild them and all looks fine. However I can't ad asp controls to the view, edit or settings controls and get a error message - Error Creating Control - CheckBox1 - Error HRESULT E_FAIL has been returned from a call to a COM component. I'm using VS10 SP1, have reloaded it and tried combinations of .net 2.0, 3.5 and 4.0 with no success. Is this something you've seen or have a solution for? Searching the web shows it's not uncommon but I've yet to find a solution.
Thanks in anticipation.

By Rick Jones on   10/14/2011 10:06 AM
Gravatar

Re: Using and Customizing a C# Module Development Template

Hello,
I have 2 questions:
1. AssemblyInfo
I have used your C# module template. In AssemblyInfo.cs entered [assembly: AssemblyVersion("1.00.*")]
and want to display in View.ascx with: lResponse.Text = this.GetType().Assembly.GetName().Name + " " + this.GetType().Assembly.GetName().Version.ToString() + " " + DotNetNuke.Application.DotNetNukeContext.Current.Application.Version.ToString();
In displays: App_Web_3oziz5m3 0.0.0.0 6.0.0.2982
Q: where does App_Web_3oziz5m3 come from? (in DNN bin folder there is ModuleName.dll as is project name and no App_Web_... dll file)
Q: how to display info from ModuleName AssemblyInfo.cs file?

2. Localization
Currently getting value with Localization.GetString(key, this.LocalResourceFile, System.Threading.Thread.CurrentThread.CurrentCulture.ToString());
Q: why doesn't Localization.GetString automatically reads CurrentCulture property
Q: I found that within DNN if system language is en-us, and have resource file View.ascx.en-us.resx it does not get value, it needs to be without en-us. For none-default languages it works.

Thank you,
David

By david last on   10/14/2011 9:43 AM
Gravatar

Re: Using and Customizing a C# Module Development Template

David,

1) I don't know about the version info from the DLL, that shouldn't be DNN specific though, so whatever code is typically necessary for a DLL version info should work.

2) As for localization, you shouldn't need to pass the Culture in, are you using asp.net localization instead of the DNN localization perhaps? Check out dnnsimplearticle.codeplex.com for examples of some localization

By Chris Hammond on   10/14/2011 9:48 AM
Gravatar

Re: Using and Customizing a C# Module Development Template

Hi chris,

Thanks for your guide and template i am able to create demo module and run on DNN website .
you mentioned above that you gonna put some sample project that uses this template for easy understanding on codeplex but i wasnt able to find it there ... on 6/23/2010 comment
please provide those links if you have posted them somewhere

thanks agains for great guide for building module in DNN

By newbiefreak on   11/28/2011 1:04 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

@newbiefreak check out dnnsimplearticle.codeplex.com

By Chris Hammond on   11/28/2011 1:04 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

Thanks for this excellent post chris.. even a beginner like me was able to set it up smoothly in one go.

Now is the troubling part, can you please clarify me on how would I add contents to the module, for example suppose i create a banner module from you templates in which in View.ascx i add an asp:image, tell me where would I store the path of the image that i setup and how would the module distinguish between the contents of the two instances of my modules on different pages.

I just need a few key points that could push me in the right direction, dont want to trouble you more..

By Ather Hashmi on   1/6/2012 6:48 PM
Gravatar

Re: Using and Customizing a C# Module Development Template

Ather, check out the dnnsimplearticle.codeplex.com sample module I created for more info

By Chris Hammond on   1/6/2012 6:48 PM
Attend A Webinar
Free Demo Site
Download DotNetNuke Professional Edition Trial
Have Someone Contact Me
Have Someone Contact Me

Like Us on Facebook Join our Network on LinkedIn Follow DNN Corporate on Twitter Follow DNN on Twitter

Advertisers

Sponsors

DotNetNuke Corporation

DotNetNuke Corp. is the steward of the DotNetNuke open source project, the most widely adopted Web Content Management Platform for building web sites and web applications on Microsoft .NET. Organizations use DotNetNuke to quickly develop and deploy interactive and dynamic web sites, intranets, extranets and web applications. The DotNetNuke platform is available in a free Community and subscription-based Professional and Enterprise Editions with an Elite Support option. DotNetNuke Corp. also operates the DotNetNuke Store where users purchase third party apps for the platform.