Sunday, August 23, 2009

Set IE8 Compatibility Mode in Dot Net Nuke

Microsoft has just released Internet Explorer 8. Unfortunately, some of the pages on our website have some issues when viewed with IE8's default settings. In particular, the styling that we've done on our main page's tab control is causing issues. Users can fix these issues on the client side by selecting compatibility mode (the button to the right of the URL field shown below).






Of course, a client side fix is never a user friendly fix. Thankfully there is a meta tag that can be added to your site to force IE8 to automatically go into compatibility mode.

Our page is built in Dot Net Nuke. The appropriate way to apply this fix for DNN is to add the tag to the default.aspx file that is found in the root directory of your Dot Net Nuke website. Any meta tag that is placed in here should be applied to all pages to your website. Add the tag highlighted below in red at the top of the head section of the default.aspx file.

< id="Head" runat="server">
< equiv="X-UA-Compatible" content="IE=EmulateIE7">
< content="text/html; charset=UTF-8" equiv="Content-Type">

Note that the tag must be placed at the top of the head section. Also, be aware that updates of your DNN framework will overwrite this change.

Tuesday, August 18, 2009

Create DotNetNuke Page Description And Meta Tags Dynamically

public DotNetNuke.Framework.CDefault BasePage
{
get { return (DotNetNuke.Framework.CDefault)(Page);
}
}

protected override void OnInit(EventArgs e)
{ base.OnInit(e); BasePage.Author = "John Doe"; BasePage.Comment = "Some Comment"; BasePage.Copyright = "Some Organization"; BasePage.Description = "Some Description"; BasePage.Generator = "Some Generator";
BasePage.KeyWords = "Keyword A, Keyword B" BasePage.Title = "Some Title";
}

Monday, August 17, 2009

Check ajax installed or not in dnn at page load

if (DotNetNuke.Framework.AJAX.IsInstalled())
DotNetNuke.Framework.AJAX.RegisterScriptManager();

Wednesday, August 12, 2009

Redirec from one module to other

Step 1:

Response.Redirect(Util.RedirectUrl(this.PortalId, this.TabId, "ControlName", "ModuleName"), false);

Step 2:

public static string RedirectUrl(int PortalId, int TabId, string ControlName, string ModuleName, string Querystring)
{
string _Url = string.Empty;
ModuleInfo objModule = GetModuleByDefinition(PortalId, ModuleName);
return DotNetNuke.Common.Globals.NavigateURL(objModule.TabID, ControlName, "mid=" + objModule.ModuleID.ToString(), Querystring);
}
/////////////////////OR if using querystring

public static string RedirectUrl(int PortalId, int TabId, string ControlName, string ModuleName, string Querystring)
{
string _Url = string.Empty;
ModuleInfo objModule = GetModuleByDefinition(PortalId, ModuleName);
return DotNetNuke.Common.Globals.NavigateURL(objModule.TabID, ControlName, "mid=" + objModule.ModuleID.ToString(), Querystring);
}