Skip to main content


Showing posts from 2013

How to Add Secured File On DNN

Dear All
If you want to upload any image, PDF or any other file in DNN as secured file and you want it will be accessible to  specific Group, member or any register member then follow the below steps :

1) Login to your host
2) Go to File Manager
3) Select the Folder type "Secured" instead of standard
4) Press on Create folder button

After Folder creation apply the permission through bottom permission window

Rashid Imran Bilgrami

Adding Awesome Calender in Dotnetnuke or DNN Module

Dear Readers
Today i found the very easy solution for display calender in DNN module by two easy steps

DotNetNuke provides with inbuilt jquery.js and jquery-ui.js so you don't have to bother to link them separately In regular html / application you would have to add following lines in
<head> tag
<script src=""></script>  
<script src=""></script>  
<link rel="stylesheet" href="" />

Note: If you did not see the calender then copy and past the above link 

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/javascrip…

Allow Anonymous Authentication at website through IP Address or Computer Name

Dear All,
Today i resolved an issue which is very basis but the solution is little bit tricky. The problem was related to accessing the website on LAN through IP or the domain name by anonymous user.

I setup the site through IIS and run it on local host, the website runs perfectly. But when I tried to access the same website through IP Address  or Domain Name it's prompting the user name and password.

I do the following steps but i did not get any success 

1) Open the site property in IIS through website property and allow anonymous access
Result the website still ask me user name and password

2) Open the web.config and add the following code
        <allow users="*"/> //Allow everyone
Result the website still ask me user name and password

3)  I made the the directory permission on every one and IIS user
Result the website still ask me user name and password

4)  I change the IIS_USER to Administrator
Result the websi…

Drop Shadow With CSS For All Web Browsers

Dear Readers
I found an article for drop shadow supported in all browsers

Ref URL:

One of the most common CSS effects is using shadows in various ways. Before, we needed to resort to images, but now we can offer this to all major web browser with CSS!

Web Browser Support

Believe me or not, but all of these web browsers we can offer shadows with CSS:

Firefox 3.5+Safari 3+Google ChromeOpera 10.50Internet Explorer 5.5The Standards Way

As we all know, a majority of the web browsers implement features in a standardized way, while others don’t (although they are getting better at it). Previously, in the W3C specification CSS Backgrounds and Borders Module Level 3 box-shadow was described, although at the moment, it’s not in there for some things to be discussed further. Anyway, this is how the implementation looks:

.shadow {
box-shadow: 3px 3px 4px #000;

The first value describes the x-offset (could be a negative v…

How to modify the page title with respect of your module in Dotnetnuke or DNN

Dear Readers This is actually a very simple trick to do inside of your modules, though you might need to setup an option to allow this to be turned on or off depending on what the site administrator wants the page title to be.

In C# you can use the following code

DotNetNuke.Framework.CDefault tp = (DotNetNuke.Framework.CDefault)this.Page;

tp.Title = "This is my page title";

So the next time you're coding a module and need to change the page title, it's that simple.

Rashid Imran Bilgrami

DNN content Localization with front end control

Dear All
It's very small but it save time instead of setting the localization value all the time from the code behind, by using this code you can control it with the front end controller

<asp:Button ID="Button2" runat="server" resourcekey="PrintButton.text"/>

Here resourcekey is use for localization and printbutton.text is define under the resx file

I hope it helps you for saving the time

Rashid Imran Bilgrami

DNN 7 Won't go into edit mode or not working with control bar

Dear All,
Today when i install the DNN 7 then i found and issue in edit mode after installation.

The problem is when i go to edit mode the page refresh with out enabling the edit mode, after a short research on Google i found the solution. I hppe it save your time

1. backup your web.config

2. Open your web.config in a text editor

3. within the web.config file, find the <system.webserver><modules> section.

4.  If the <modules> section says <modules runAllManagedModulesForAllRequests="false"> change it to <modules runAllManagedModulesForAllRequests="true">
 if it just says <modules>, change it to <modules runAllManagedModulesForAllRequests="true">

5. Save the config file.

6. Retry by refreshing the page and trying again.  You can also test this out by trying to a do a journal post (which also uses the services framework in an authenticated way.

If some how its will not work then, you must change the control pane…

Javascript not working when enable the AJAX in DNN or .net

Dear All,
Today i found a solution finally to rebind the Javascript issue with support partially run with DNN

Here is the key
<script type="text/javascript">
    function BindControlEvents() {
        //jQuery is wrapped in BindEvents function so it can be re-bound after each callback.
        //Your code would replace the following line:
            $('#<%= TextProtocolDrugInstructions.ClientID %>').limit('100', '#charsLeft_Instructions');        

    //Initial bind
    $(document).ready(function () {

    //Re-bind for callbacks (This is a key)
    var prm = Sys.WebForms.PageRequestManager.getInstance();

    prm.add_endRequest(function() {


Rashid Imran Bilgrami

Update Panel not working after converting an application to 1.1 to 3.5

Dear Friend

We have a project which was previousely in 1.1. I converted that into .net 3.5.Everything is working fine except Update Panel. We add the update panel in my form and put some controls in contenttemplate.

when we click the button inside the update panel make post back so other controls out side update panel also get refresh.

We tested the same code in new 3.5 website.There it is working there any issue while we convert the project

The solution is very simple

Open you web.config file
delete this line <xhtmlConformance mode="Legacy"/>


Rename the old web.config file and create new one the problem will resolve

Rashid Imran Bigrami

C# Generate All Dates between starting and ending date

Dear Readers
This code  will return a generic list of DateTime containing the dates between a starting date and ending date: 

//Here is the function

private List<DateTime> GetDateRange(DateTime StartingDate, DateTime EndingDate)
    if (StartingDate > EndingDate)
        return null;
    List<DateTime> rv = new List<DateTime>();
    DateTime tmpDate = StartingDate;
        tmpDate = tmpDate.AddDays(1);
    } while (tmpDate <= EndingDate);
    return rv;

//Here you call this function

DateTime StartingDate = DateTime.Parse("02/25/2007");
DateTime EndingDate = DateTime.Parse("03/06/2007");
foreach (DateTime date in GetDateRange(StartingDate,EndingDate))

And it will return as result:

Rashid Imran Bilgrami

Schedule Back Up Of Your SQL DB

Dear All,
I hope this post save your time, If you need to make the scheduled for daily backup in SQL please follow the following steps:

Steps for Generate the SQL Script for backup 
1) Right click on the Database
2) Click on Task
3) Click on Backup
4) Click on the Script Button

5) Once you click you will get the script like that
BACKUP DATABASE [DNNFrsh] TO DISK = N'Drive:Path\databaseName.bak' WITH NOFORMAT, NOINIT, NAME = N'databaseName-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10GO

6) Right Click on SQL Server Agent
7) Click on the New Job
8) Fill the required name and other field
9) In Step section Paste the Backup query that you generated in the above step
10) After that set the scheduled timings and save it

Your schedule is ready now!

Rashid Imran Bilgrami

Passing more then one parameter in Datalist or Datagrid image button link

Dear Readers,
Here is the code that helps you to pass more then one parameters in asp button

ASPX or ASCX code 
<asp:GridView ID="GridViewUserScraps" ItemStyle-VerticalAlign="Top" AutoGenerateColumns="False" Width="100%" runat="server" OnRowCommand="GridViews_RowCommand" >
            <asp:TemplateField SortExpression="SendDate">
                <asp:Button ID="btnPost" CssClass="submitButton" Text="Comment" runat="server" CommandName="Comment" CommandArgument='<%#Eval("ScrapId")+","+ Eval("UserId")%>' />


Code Behind Function 

 protected void GridViews_RowCommand(object sender, GridViewCommandEventArgs e)
    if (e.Comm…

Get DNN Module Tab ID or Redirect custom module to another custom module

Dear Friends
Its common and easy that how to find the DNN module ID for redirecting one module to another. I am posting for those who did not have an idea how to redirect your one custom module to another through programming

public int findPageTabId(string friendlyName, int portalId)

            int intModTabID = -1;
            ModuleInfo objModuleInfo = new ModuleInfo();
            ModuleController objModuleContr = new ModuleController();
            objModuleInfo = objModuleContr.GetModuleByDefinition(portalId, friendlyName);
            intModTabID = objModuleInfo.TabID;
            return intModTabID; 


on the button click or any function you can call this function with redirect option 

  protected void Button3_Click(object sender, EventArgs e)
            int tabId=0;
            UDF myudf = new UDF();
            tabId = myudf.findPageTabId("Your module friendly Name", this.PortalId);