Friday, October 12, 2012

Adding jquery calendar control to DotNetNuke module



jQuery provides with calendar and they call it datepicker
DotNetNuke provides with inbuilt jquery.js and jquery-ui.js so you don't have to bother to link them separately
In regular html / asp.net application you would have to add following lines in <head> tag
     <script src="http://code.jquery.com/jquery-1.8.2.js"></script>     <script src="http://code.jquery.com/ui/1.9.0/jquery-ui.js"></script>     <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.0/themes/base/jquery-ui.css" />

You dont need them in DNN.
If you are developing a custom DNN module add this to your user control view.ascx file.
I have txtStartDate as a text field on the form where I wanted my calander to be rendered on click.
To achieve this I added this code at the top of my ascx page after the standard includes.
<script type="text/javascript" >
$(function () {
    $("#<%= txtStartDate.ClientID %>").datepicker();
});
</script>
The calender takes the size based on your text size if it is appearing bigger that your expectation
set it style like this
<style>
div.ui-datepicker{
font-size:10px;
}
</style> 

Tuesday, September 18, 2012

Getting Current User Info in DotNetNuke

// DNN Get Current User


// The Current user information can fetch using UserController and
// is availble as UserInfo object:
 

 private UserInfo _currentUser =
                   DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo();

// To get UserID of the current user we can then access the fetched UserInfo object:

 int UserID = _currentUser.UserID

Tuesday, September 04, 2012

DotNetNuke Error: System.Web.UI.UserControl' does not contain a definition for 'CreatedByUser'


Another tiring issue because of  automatic code generation of .designer.cs while building
DotNetNuke Module from asp.net User Control.

My asp.net user control was working flawlessly when I converted it in to DNN Module it was
not getting build. It was giving this error.

Error 16 'System.Web.UI.UserControl' does not contain a definition for 'CreatedByUser' and no extension method 'CreatedByUser' accepting a first argument of type 'System.Web.UI.UserControl' could be found (are you missing a using directive or an assembly reference?)


Solution:

I found the reason.. Apparently when a rename occurs the definitions are changed.
Originally the definitions where these:
protected global::DotNetNuke.UI.UserControls.LabelControl lblContent;
protected global::DotNetNuke.UI.UserControls.ModuleAuditControl ctlAudit;


After the renaming, they magically became these:
protected global::System.Web.UI.UserControl lblContent;
 protected global::System.Web.UI.UserControl ctlAudit;

As did every other control in the .designer.cs files!


Ref : http://www.dotnetnuke.com/Resources/Forums/forumid/199/threadid/355899/scope/posts.aspx


DNN Error - Could not create type 'DotNetNuke.Modules.Journal.ProfilePic


'Error 21 Could not create type 'DotNetNuke.Modules.Journal.ProfilePic''  
I was getting this error in when I was trying to compile latest DotNetNuke Community Edition CMS Version 06.02.0
This issue was appearing weird as the file contained no code. There was nothing could be done about it.
But finally it seems to build packaging problem from DNN Team. 

"You may safely delete this file." is what the DNN guys says. huh. thats a big relief ! !

>>Reply from DNN<<

There seems to be a file in the install package that shouldn't have been included. If you see a file named ProfilePic.ashx in the DesktopModules/Journal directory you can safely delete this file. This file was created before we moved to handler that was integrated with the core project.

Will Morgenweck
Director of Product Management
DotNetNuke Corp.

Tuesday, August 21, 2012

Ek Tha Tiger




He lived/s in Kahna ....

Was visited by Tigers Adventure Campers ....
www.tigers9.com


Thursday, August 09, 2012

IIS Server on Windows 7 Home Basic



To Install IIS 7.5 on Windows 7 Home

Click Start and then click Control Panel.

In Control Panel, click 'Programs and features' then click 'Turn Windows features on or off'.

In the Windows Features dialog box, click Internet Information Services and then click OK.

Developers are recommended to select Application Development Features or Web Management Tools in the  check boxes associated with those features.

P.S. Getting ready on DNN Module Development. Keep watching this blog for more updates on same ...  ;)