this blog contains information for .net and sql stuffs. You can find various tips and tricks to overcome problem you may be facing in ...

Friday, January 23, 2009

Start your First DNN Project

DNN provides a quick way to create website. Its one type of CMS(content managment system)

To stat your first DNN enabled website download dnn kit from now install it.

Open your visual studio and go to create website. 
Now in templates you have options to create website with DNN template. If you have installed more than one DNN template then you will have differen versions in it.

Select any one DNN template and create it.

After few minutes you have all dnn required components in your solution browser.

To run this website you need to have one database that store all information for you. you can have any sql server database either sql express or sql server.

Go to SQL server and create one database with out creating any objects.

Now back to your visual studio , open web.config file Under the  section add your connection string name and specify connection string  (connection string will be used by DNN to store your data and where your database is located)

Also in section  add one key with same name you have given in to connectionString. (this is for backward compability)

You can now run this website by Visual studio run facility but some time it not works properly.
So Its better to use old virtual directory concepts.

Go to run -write inetmgr It will open Internet Information Services dialog box for you. 

In IIS go to web sites->Default Web Site now write click on it go to new create new virtul directory. In this creating virtul directory wizard specify your website location and give virtual directory name.

Now you are ready to run your first DNN website. Open any browser Write url as http://localhost/nameofyour virtual directory  

If you are opening this url first time then it will configure your DNN database. It will guide you to add user and creating users. It will also create stored procedure and tables required to run DNN website in database.

Now if you go to SQL server and see database you have created for your DNN website then got surprised that now it has many tables and stored procedure this all are created when you have configured DNN website.

In DNN website you can add page dynamically means in browser run your website and from browser you can add new page align page and many more.

If you want to add new functionality to your DNN project then you need to develop modules then you can register this module to your dnn website and add this to appropriate page.

To create any module
Go to visual studio in solution explorer find DesktopModules folder and add new folder to this folder ,in this folder add new usercontrol you want to add. make sure all modules are inherited from  DotNetNuke.Entities.Modules.PortalModuleBase class otherwise it will show error to display this module in webpage.

After creating this module you have register this to your website. So go to browser and open your website in top you have panel that contains different modules in that click on install addition modules and browse your module you have created in your visual studio.

Now when you go to modules in top panel you have your module in your dropdown box. Add this module to your page and you can use it as you are using in anyother website.

This is just a kick start to create any DNN website besides this we can have lots more stuff to create a fine website. Like skins,css designing and many more.

No comments: