DotNetNuke Hosting with ASPHostPortal.com

BLOG about DotNetNuke CMS, latest technology and Special DotNetNuke Hosting Package with ASPHostPortal.com

DotNetNuke Hosting - ASPHostPortal.com :: How To Compile DNN Module Using Visual Studio Starter Kit

clock February 23, 2017 04:50 by author Armend

The Visual Studio Starter Kit enables you to create a compiled DotNetNuke module that can be much more compact, more quickly, and hide your supply code from prying eyes. The subsequent instructions can get you started and well in your approach to creating compiled DotNetNuke Modules.

  1. Download the Starter Kit
  2. Open Visual Studio  and create a new project (File -> New Project)

  1. From the dialogue follow these steps

    • Select Web from the Installed Templates. I use of VB.Net, but they are available in C# too.
    • Pick DotNetNuke Compile Module from your Project Type list.
    • Enter your Module Name
    • Enter the path for your DotNetNuke installation. Your project will be installed within the current set up within the DesktopModules folder and also the dll will likely be place in the bin folder.
    • Click OK
  2. Visual Studio will load up the venture within the Solution Explorer and open the Documentation.html in the editor. You’re not however ready to set up the module so don’t keep to the DotNetNuke documentation but.
  3. In the Solution Explorer right click on My Project and select Open.

Within the Application tab delete the entry in Root Namespace except if this is your only module, otherwise you will not be sharing code with other modules. I have a undertaking that spans numerous modules and i want them all inside the identical identify space. So, I delete the basis Namespace entry to ensure that I am able to put within the appropriate namespace from the code driving. (Edit regarding Root Namespace; in C# you do not need to clear the namespace, but in VB.Net you are doing).

  1. Switch towards the Compile tab. Verify the Build output path and make sure its pointing towards the proper bin folder. Now simply click the Advance Compile Option on the button of the tab. Around the dialogue make certain the target framework is correct. You’ll see the environment on the base of the dialogue. At this point the dialogue will immediately near.
  2. Repeat step 4 (open the project properties) then go to step 8
  3. Switch to the References tab.  You should see a reference to DotNetNuke.Library version 0.0.0.0.  Remove it

Nonetheless around the References tab, now click the Add button. Inside the Add Reference dialogue switch to the Browse tab and navigate for the DotNetNuke set up bin folder. Choose the DotNetNuke.dll, DotNetNuke.Web.dll, as well as the Telerik.Web.UI.dll. Should you do not hold the Telerik.Web.UI.dll then you definitely should not be making use of those controls and you also will not want the dll. Click Okay. These references are necessary to obtain access to the DotNetNuke methods and properties. In any other case you are code powering will be crammed with inexperienced and blue underlines, missing references, and, oh yeah, it won’t compile. Sort of defeats the aim, proper?

  1. Intellisense; this step is optional, but if you want Intellisense you’ll want to do this.  Switch to the Web tab. Under Servers select the “Use Local IIS Web server” option.  Change the Project URL to the full URL of your project (eg http://{domain}/DesktopModules/{project folder}).  Check “Override application root URL” and set it to the domain of your DotNetNuke install (eg http://{domain})
  2. Save the Project Properties and close it.
  3. Inside the Solution Explorer increase the Components folder and open up the ModuleNameController.vb (or .cs) file. Check the Namespace declaration and you’ll see that it states “YourCompany”. Change this to your customized namespace identifier and after that do the identical in each of the code powering documents. You will also need to change it inside the .ascx files because they’ll be reference the namespace inside the handle declaration at the best of the webpage.
  4. At this point you can Build your project and you will see the new dll in your DotNetNuke install bin folder.
  5. Now follow the instructions in the documentation.html to install the module in DotNetNuke.  Once the module is installed you don’t really need the documentation folder, or it’s files.  I usually delete it.

Best DotNetNuke Hosting Recommendation

ASPHostPortal.com
ASPHostPortal.com provides its customers with Plesk Panel, one of the most popular and stable control panels for Windows hosting, as free. You could also see the latest .NET framework, a crazy amount of functionality as well as Large disk space, bandwidth, MSSQL databases and more. All those give people the convenience to build up a powerful site in Windows server. ASPHostPortal.com offers DotNetNuke hosting starts from $5/month only. We also guarantees 30 days money back and guarantee 99.9% uptime. If you need a reliable affordable DotNetNuke Hosting, we should be your best choice.



DotNetNuke Hosting - ASPHostPortal.com :: How To Manage Pages in DNN

clock February 16, 2017 05:05 by author Armend

To create a new page in DNN is pretty simple. After you login on the site, look for the menu Pages and hover your mouse into the menu, a sub menu will appear under the menu. Click the option Add New Page.

A pop up window will appear like below.

Page Properties in DNN

Below is the main properties that you will basically utilize in daily use.

  • Page Name : Page name must unique and can not be duplicate or has the same name with other pages. What ever you type in here, it will appear exactly in the site menu.
  • Page Title : Page Title is used for meta tag Title. You can optimize your site by specifying individual unique title for each page.
  • Page URL : You can define your own custom url in here. This will help optimize your site for SEO purposes.
  • Description : This will be used in meta tag description. You can include a brief description about this page.
  • Keywords : This will be used in meta tag keyword. You can separate a keyword by comma. Note: most search engine will no longer consider the meta keyword as important factor for search engine search.
  • Include in Menu : By untick this one, the menu will be hidden and will not be visible in the site menu.

Manage Page's Permission

Each page has its own permission. If you see below picture,


The page permission will list available roles in the current site portal. By default Administrators, All Users, Registered Users, Subscribers, Translators, Unauthenticated Users, and Unverified Users are predefined in DNN. What we interest most are probably All Users which cover all user roles, Registered Users which cover registered members only and Administrators which covers admin account only. If you want to make the site visible to all users then you should tick All Users View Option. The Edit option, give ability to specific role to edit the content of the page. The content in here are the modules of the page, it could be HTML modules, news modules etc. If you do not want any public users able to view this page, you can set to Registered Users. But if you want to give the page visibility to admin only, then you should choose Administrators.


Alternatively, you can use Page Managements to manage your site pages easily. This menu is available under the Site menu. Please see below screenshot.

 

All your pages will be displayed in a tree menu on the left hand side. To edit the page, you can just click the menu name. If you want to delete the page, you can just simple right click the menu link.

Best DotNetNuke Hosting Recommendation

ASPHostPortal.com
ASPHostPortal.com provides its customers with Plesk Panel, one of the most popular and stable control panels for Windows hosting, as free. You could also see the latest .NET framework, a crazy amount of functionality as well as Large disk space, bandwidth, MSSQL databases and more. All those give people the convenience to build up a powerful site in Windows server. ASPHostPortal.com offers DotNetNuke hosting starts from $5/month only. We also guarantees 30 days money back and guarantee 99.9% uptime. If you need a reliable affordable DotNetNuke Hosting, we should be your best choice.

 



DotNetNuke Hosting - ASPHostPortal.com :: How To Search part of the DNN core

clock February 9, 2017 05:00 by author Armend

DNN Search is part of the DNN core that may be installed and configured out with the box.

 

DotNetNuke Search consists of four primary pieces:

  • Scheduled Job
    The scheduled process initiates the approach of indexing the modules, in the scheduled time interval. An iteration of all modules that support iSearchable is performed. Throughout this process, text that is extracted in the module is cleaned, parsed, and added to search word and search things tables.
  • Search Admin
    The search admin is for setting the maximum word length, minimum word length, selection to involve typical words, plus the alternative to consist of numbers.
  • Search Input Module
    A module or skin object is often made use of to provide the form for the search query. In module settings, you may make use of the default button, or an image. You do not have the selection to transform this image inside the module, nor change the text. Types is often made use of to produce some look and feel modifications, nevertheless it is limited. When a search is performed, the user is redirected for the Search Results web page.
  • Search Outcomes Module
    This module offers the search benefits. Within the settings, you can set the maximum search results, final results per page, maximum title length, maximum description length, along with the selection to show description. Final results are restricted for the exact word queried.


SEARCH DotNetNuke

The ISearchable interface is utilised to permit the users of one's module to look for content material employing the search mechanism provided by the DotNetNuke framework It works a lot more like an index inside the back of a book. The only things in the index are products that the author (in this case the module developer) has decided to put there. The search merely enables DotNetNuke portal users to speedily find things placed within this index.

Implementing Look for the Survey Module

To implement search for the Survey module we performed three measures:

Indicate that the controller class will implement the ISearchable interface

  • Insert the code for the ISearchable interface
  • Update the module configuration

Implement ISearchable in the Controller Class

When you look at the module definition for the Survey module, you can see that the controller

class defined is DotNetNuke.Modules.Survey.SurveyController
Public Function GetSearchItems(ByVal ModInfo As Entities.Modules.ModuleInfo) _
As Services.Search.SearchItemInfoCollection Implements Entities.Modules.ISearchable.GetSearchItems
' Get the Surveys for this Module instance
Dim colSurveys As List(Of SurveyInfo) = GetSurveys(ModInfo.ModuleID)
Dim SearchItemCollection As New SearchItemInfoCollection
Dim SurveyInfo As SurveyInfo
For Each SurveyInfo In colSurveys
Dim SearchItem As SearchItemInfo
SearchItem = New SearchItemInfo _
(ModInfo.ModuleTitle & " - " & SurveyInfo.Question, _
SurveyInfo.Question, _
SurveyInfo.CreatedByUser, _
SurveyInfo.CreatedDate, ModInfo.ModuleID, _
SurveyInfo.SurveyId, _
SurveyInfo.Question)
SearchItemCollection.Add(SearchItem)
Next
Return SearchItemCollection
End Function

To implement the search we performed 3 methods:

  • Developed and filled a SearchItemInfo object
  • Added this object for the SearchItemInfoCollection collection
  • Returned the SearchItemInfoCollection as the output for the approach
  • The essential point to remember is that the SearchKey parameter has to be a one of a kind value. In this case we passed the contents from the SurveyId field (in the Surveys table) towards the SearchKey parameter.
  • The Content material is the content that the portal customers will likely be looking on. We passed the contents on the Question field towards the Content parameter. As you are able to see within the table schema under, the Question field includes a direct one-to-one connection together with the SurveyID field.

This line adds the SearchItemInfo object for the SearchItemInfoCollection collection:
SearchItemCollection.Add(SearchItem), This line returns the SearchItemInfoCollection collection because the output on the technique:

Return SearchItemCollection

Best DotNetNuke Hosting Recommendation

ASPHostPortal.com
ASPHostPortal.com provides its customers with Plesk Panel, one of the most popular and stable control panels for Windows hosting, as free. You could also see the latest .NET framework, a crazy amount of functionality as well as Large disk space, bandwidth, MSSQL databases and more. All those give people the convenience to build up a powerful site in Windows server. ASPHostPortal.com offers DotNetNuke hosting starts from $5/month only. We also guarantees 30 days money back and guarantee 99.9% uptime. If you need a reliable affordable DotNetNuke Hosting, we should be your best choice.




DotNetNuke Hosting - ASPHostPortal.com :: Writing a New Authentication in DotNetnuke

clock February 2, 2017 05:00 by author Armend

My companion organization already had ADFS setup. My purpose was to have the partner organization authenticate the user after which have DNN automatically recognize the user, not obtaining to enter any far more credentials. From there we wanted to manage the groups and permissions by way of the standard DNN portal.
I was initially beneath the misconception that I couldn't make use of the present DNNMembershipProvider and I'd have to generate a whole new Authentication Provider and gather the credentials and pass them to my partner organization.

What I have figured out is that you can use the existing DNNMembership provider, but you've got to make the user ahead of the request gets towards the DNNMembership provider making use of the info offered by ADFS.

Note: This approach is really a straight pass-through from ADFS to DNN. No measures are taken to authenticate the user or to check any from the inputs from ADFS.

As an aside, this method performs not just with ADFS but in addition any other external 3rd-party Authentication approach that sends user info in headers or cookies. Change the context_AuthenticateRequest approach to suit your requirements.

Right here are the pre-conditions to this article. I expect:

  • Your partner organization has ADFS up and running
  • You have your ADFS proxy up and running and it talks to the partner organization.
  • ADFS Web Agent is installed on the server you are running.

Let’s get begin.

HTTPModule

What you've to complete is produce an HTTPModule that will intercept the AuthorizeRequest events ahead of DNN does. An over-simplified definition of an HTTPModule is, it is a piece of code that runs ahead of any web page gets hit. You can listen for a large amount of distinct events. For much more data, click right here.

To make the HTTPModule you'll need to:

  • Open Visual Studio and produce a brand new class library.
  • Generate a brand new class and copy the code attached to this blog.
  • Add References to the following DLLs
    • DotNetNuke
    • System.Web
    • System.Web.Security.SingleSignOn
    • System.Web.Security.SingleSignOn.ClaimsTransform
    • System.Web.Security.SingleSignOn.Permissions
  • Compile the solution
  • The DLL that is created will need to be placed in the bin directory of your website.
  • Make changes to your web.config (explained in a later section).

I will walk through a bit of the code. Here is the first snippet of code. We start listening for the AuthenticateRequest event. All other events pass through untouched.

public void Init(HttpApplication context)
{
//Start listening for each authentication request
context.AuthenticateRequest += new EventHandler(context_AuthenticateRequest);
}

Now, what do we do when this event is fired off? To shorten the namespace I added the statement

using SSO = System.Web.Security.SingleSignOn;

First off, we need to get the information that ADFS has sent us by casting the User.Identity into the ADFS object SingleSignOnIdentity.

public void context_AuthenticateRequest(object sender, EventArgs e)
{
HttpApplication app = (HttpApplication)sender;
//By the time the request gets to here, it should have been authenticated
//against ADFS.
SSO.SingleSignOnIdentity id = (SSO.SingleSignOnIdentity)app.User.Identity;

At this point you will have access to the user’s Identity and any claims coming from the ADFS server. You can access them through id.SecurityPropertyCollection. You can use them to populate the new user account. You can iterate through the claims with the following code

foreach(SecurityProperty sp in id.SecurityPropertyCollection)
{
    Console.WriteLine(sp.Name);
    Console.WriteLine(sp.Value);
}

Subsequent, we check to determine in the event the use currently exists within the database by utilizing the DNN API function GetUserByName. If it doesn’t, then the user is created by the common DNN API function CreateUser and logged in. If the user does exist currently then we log them in automatically. The user will automatically be added to the Registered Users and Subscribers security groups.

//'See if user exists in DNN Portal user DB
UserInfo objUserInfo = UserController.GetUserByName(currentPortal.PortalId, id.Name);
//' user does exist - try to create on the fly
if (objUserInfo == null)
{
    objUserInfo = new UserInfo();
    objUserInfo.DisplayName = id.Name;
    objUserInfo.FirstName = id.Name;
    objUserInfo.LastName = id.Name;
    objUserInfo.Username = id.Name;
    objUserInfo.Membership.Password = "AReallyStrongPassword";
    objUserInfo.PortalID = currentPortal.PortalId;
    objUserInfo.Email = id.Name;
    UserCreateStatus objUserCreateStatus = UserController.CreateUser(ref objUserInfo);
    //See if the user was added successfully
    if (objUserCreateStatus == UserCreateStatus.Success)
    {
        //We have created them successfully, so let them into the site
        LetsLogUserIn(objUserInfo);
    }
    else
    {
        //This will send the error to the error log, but the user will experience an infinite loop
        throw new Exception("User not created successfully: " + objUserInfo.Username + "- " +         objUserCreateStatus.ToString());
}

Here is the LetsLogUserIn function:

private void LetsLogUserIn(UserInfo objUserInfo)
{
    try
    {
    //Get the current portal
    PortalSettings currentPortal = PortalController.GetCurrentPortalSettings();
    //set the language to the default language of the portal
    Localization.SetLanguage(currentPortal.DefaultLanguage);
    //Log the user in
        UserController.UserLogin(currentPortal.PortalId,
            objUserInfo,
            currentPortal.PortalName,
            HttpContext.Current.Request.UserHostAddress,
            false);
    }
    catch(Exception ex)
    {
        Exceptions.LogException(ex);
    }
}

Web.Config

We need to make several changes to the web.config. First we need to make the changes necessary for ADFS and then we need to make changes for our HTTPModule.

The ADFS changes are the standard web.config changes you would do for any ADFS claims-aware site. You first need to add the section groups to your web.config.

<sectionGroup name="system.web">
    <section name="websso" type="System.Web.Security.SingleSignOn.WebSsoConfigurationHandler,                                  System.Web.Security.SingleSignOn, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null" />
</sectionGroup>

Then you need to add the actual section. The <returnurl> needs to be EXACTLY what is put into ADFS. Remember, this URL needs to have a / at the end to prevent ADFS from posting to a directory listing. The <fs> element needs to be changed to reflect the name of your server.

<system.web>

    <websso>
        <authenticationrequired />
        <auditlevel>55</auditlevel>
        <urls>
            <returnurl>https://your_application/</returnurl>
        </urls>
        <fs>https://fs-server/adfs/fs/federationserverservice.asmx</fs>
    </websso>

</system.web>

If you would like to have logging (and who doesn’t like loggingJ) you will need to add the following section at the end of your web.config

<configuration>

<system.diagnostics>
     <switches>
       <!-- enables full debug logging -->
       <add name="WebSsoDebugLevel" value="255" />
     </switches>
     <trace autoflush="true" indentsize="3">
       <listeners>
         <!-- either create a c:\logs directory and grant Network Service permission to write to it, or remove this listener -->
         <add name="MyListener"
              type="System.Web.Security.SingleSignOn.BoundedSizeLogFileTraceListener, System.Web.Security.SingleSignOn, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null"
              initializeData="c:\logs\webagent.log" />
       </listeners>
     </trace>
   </system.diagnostics>
</configuration>

Ultimately, you need to add the HTTPModules for ADFS and our HTTPModule. Order matters a good deal for the HTTPModules. We require the ADFS Web Agent to become listed first, to ensure that any request will likely be redirected to our partner’s logon screen. Right away following the Web Agent should be our HTTPModule. This will make sure that we'll automatically log them on just before DNN even see it.

<system.web>
<httpModules>
    <add name="Identity Federation Services Application Authentication Module"                       type="System.Web.Security.SingleSignOn.WebSsoAuthenticationModule, System.Web.Security.SingleSignOn, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null" />
 
    <add name="HTTP_Module_Test" type="HTTP_Module_Test.SSO_Module, HTTP_Module_Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>

There you have it Hope it helps someone.

Best DotNetNuke Hosting Recommendation

ASPHostPortal.com provides its customers with Plesk Panel, one of the most popular and stable control panels for Windows hosting, as free. You could also see the latest .NET framework, a crazy amount of functionality as well as Large disk space, bandwidth, MSSQL databases and more. All those give people the convenience to build up a powerful site in Windows server. ASPHostPortal.com offers DotNetNuke hosting starts from $5/month only. We also guarantees 30 days money back and guarantee 99.9% uptime. If you need a reliable affordable DotNetNuke Hosting, we should be your best choice.

Save



About ASPHostPortal.com

We’re a company that works differently to most. Value is what we output and help our customers achieve, not how much money we put in the bank. It’s not because we are altruistic. It’s based on an even simpler principle. "Do good things, and good things will come to you".

Success for us is something that is continually experienced, not something that is reached. For us it is all about the experience – more than the journey. Life is a continual experience. We see the Internet as being an incredible amplifier to the experience of life for all of us. It can help humanity come together to explode in knowledge exploration and discussion. It is continual enlightenment of new ideas, experiences, and passions


Author Link


Corporate Address (Location)

ASPHostPortal
170 W 56th Street, Suite 121
New York, NY 10019
United States

Tag cloud

Sign in