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 Develop Web Service in DNN

clock Januarie 12, 2017 04:49 by author Armend

I have recently been assigned to built a DotNetNuke web service to permit a windows application (or any sort of net client for instance) the flexibility to control DotNetNuke person accounts (create, change roles, delete, retrieve e mail address, and so forth.).

Since I had a tough time locating an accurate code sample or documentation that really applies to DotNetNuke and accessing it without having being earlier logged in to DotNetNuke, it absolutely was difficult to constructed anything at all. I ultimately found out how to do it properly so I hard I would put my attempts to some use and write a blog publish explaining how you can get it done step by stage.

 


That said, let's begin by the fundamentals and just create a publicly available web services that permits anybody to ping the net service and acquire a pong again. For that we are going to use the new DotNetNuke 7 Providers Framework which makes it fairly simple should you know how to utilize it.

In order to create a net support that will work within DotNetNuke 7, you will need to fireplace up Visual Studio and create a class Library project (c# or VB but all illustrations listed here will be in c#).

That done, we will then reference some needed DotNetNuke 7 required libraries (making use of the Add Reference dialog box), here's the list:

DotNetNuke.dll
DotNetNuke.Web.dll
System.Net.Http.dll
System.Net.Http.Formatting.dll
System.Web.Http.dll

Then we also need to reference the System.Web class from the .NET tab of the same dialog box.

Finally, we neet to set the output path of the project to the DotNetNuke bin directory and we are ready to code.

Here is the code, the explanations follow:

using System.Net;
using System.Net.Http;
using System.Web.Http;
using DotNetNuke.Web.Api;
 
namespace MyService
{
    public class PingController : DnnApiController
    {
        [AllowAnonymous]
        [HttpGet]
        public HttpResponseMessage PublicPing()
        {
            return Request.CreateResponse(HttpStatusCode.OK, "Pong!");
        }
    }
 
    public class RouteMapper : IServiceRouteMapper
    {
        public void RegisterRoutes(IMapRoute mapRouteManager)
        {
            mapRouteManager.MapHttpRoute("MyService", "default", "{controller}/{action}", new[]{"MyService"});
        }
    }
}

  1. We merely start with some using statements for our needs as demonstrated previously mentioned
  2. We develop a namespace for our service and no matter what name we use listed here will be part of the url. I utilized MyService just for this instance but use any name which makes perception for your services.
  3. Now we create a public class for our controller. You'll be able to create numerous controllers if you want to and the controller is just a bunch of related actions that make feeling to group with each other. In my genuine project I have a PingController for testing functions, a UsersController for almost any steps that relate to user accounts and so forth. Just utilize a identify that makes feeling because it will even present up in the url. Two things for being careful right here:

    • The identify of one's controller should end using the term Controller but only what will come just before it will show inside the url, so for PingController, only Ping will show in the url route.
    • It should inherit DnnApiController so it'll use the DotNetNuke Providers Framework.
  4. Then we create the actual motion, inside our case, PublicPing. It's just a straightforward technique which return an HttpResponseMessage and may have a handful of characteristics. By default the brand new providers framework will respond only to host consumers and you also must explicitly enable other access rights if necessary, in this case the [AllowAnonymous] helps make this technique (or action if you prefer) obtainable to anyone with out credentials. The next attribute, [HttpGet] can make this action reply to HTTP GET verb, which can be usually used when requesting some date in the web server.
  5. Finally in that action, you insert whatever code you action needs to do, in this case just return the string "Pong!", just remember that you should return an HttpResponseMessage rather than a string or int or other item.

Ok so our controller and motion is done, now we just need to map that to an actual URL and that exactly what the final portion of the earlier code does. In essence this code tells DotNetNuke to map a specific url pattern for the techniques outlined in your course. You can use that code as is simply replacing MyService by no matter what your support title is.

Testing:
That is all there is certainly to it, your services is prepared! To test it, first compile it, then just navigate to http://yourdomain/DesktopModules/MyService/API/Ping/PublicPing and you should see "Pong!" inside your browser like a response.

Passing parameters

Ok, so the basic code above is working but it doesn't do anything useful. Lets add something more useful by creating an action that will give us the email address for a specific user id.

Again, here's the code and the explanations will follow (place the code inside the same namespace as the previous one):

public class UsersController : DnnApiController
    {
        [RequireHost]
        [HttpGet]
        public HttpResponseMessage GetEmail(int userid)
        {
            DotNetNuke.Entities.Users.UserInfo ui;
            ui = DotNetNuke.Entities.Users.UserController.GetUserById(PortalSettings.PortalId, userid);
            return Request.CreateResponse(HttpStatusCode.OK, ui.Email);
        }
    }


Initial we build a UsersController course which will hold all actions related to person accounts, it isn't completely required, you'll be able to have numerous steps within the same controller, nonetheless because this motion is not in any respect connected to our PingController, let'a create a new one more descriptive.

We then create a GetEmail motion (method) which will accept a userid parameter. The [RequireHost] parameter listed here will make it accessible only to host customers, we are going to see afterwards other authentication options.

The code inside the approach alone is fairly significantly self explanatory. The only interesting factor to notice listed here is the fact that because our course inherits DnnApiController, we already have a PortalSettings item obtainable. That is the big benefit of producing use of the DotNetNuke Solutions Framework. You'll have a ModuleInfo object to represent your module (if there is 1 using the identical identify as your support, which can be not essential such on this scenario), a PortalSettings object that signifies the portal at the domain title utilized to accessibility the support (portal alias) and at last a UserInfo item symbolizing the person that accessed the web services.

Testing:

If we now navigate to http://yourdomain/MyService/API/Users/GetEmail?userid=2 you need to receive the email tackle back again from the server unless of course obviously that userid does not exist, ensure that you check having a userid that truly exists for that portal. Should you exactly where not formerly linked having a host account, you then will probably be requested for qualifications.

Limiting access to particular roles

Alright, that actually works however, you need to give host qualifications to anyone needing to make use of your webservice. To avoid which you can change [RequireHost] by [DnnAuthorize(StaticRoles="Administrators")] which can limit access to administrators. Much better however, you nevertheless must provide them with an admin account. So the easy method to give only constrained entry would be to create a brand new role in DotNetNuke only for your internet services and substitute Administrators by that specific function title within the authentication parameter.

Utilizing HttpPost : (reply to a comment down bellow)

To answer Massod comment bellow, it's nearly exactly the same thing however, you have to develop an object to contain the posted information.

Let's make a easy ping that makes use of Submit, very first we need to create an object which will contain the posted info this sort of as:

public class FormMessage
    {
        public string Message { get; set; }
    }

Then we create the service method something like this:

 

public class PingController : DnnApiController
   {
       [AllowAnonymous]
       [HttpPost]
       public HttpResponseMessage PostPing(FormMessage formMessage)
       {
           return Request.CreateResponse(HttpStatusCode.OK, "Pong from POST: message was '" + formMessage.Message + "'.");
       }
   }

note that normally, a post would only return ok and no message, I am just doing this so we can test here.

Now since this is a POST verb, we can't test it by only using url parameters, we need to make an html file with a form to test it out. It would be someting like this:

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Untitled Pagetitle>
head>
<body>
    <form action="http://dnndev/DesktopModules/MyService/API/Ping/PostPing" method="POST">
        <label for="message">Message: label><input type="text" name="Message"/>
        <input type="submit" value="Submit"/>
    form>
body>
html>

The crucial thing to not right here is you can not just develop your Publish technique taking a string even when this can be only what you require, you do must create an object which will get your parameters.

Also never overlook that this is only for tests, you usually do not need to make this publicly accessible, you'd probably usually use yet another parameter than [AllowAnonymous] such as [DnnModuleAuthorize(AccessLevel = SecurityAccessLevel.View)] and [ValidateAntiForgeryToken] unless you truly want that for being public.

 

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.



DotNetNuke Hosting - ASPHostPortal.com :: Optimization SEO in DotNetNuke

clock Januarie 5, 2017 04:58 by author Armend

DotNetNuke has many SEO features, but some are less obvious to the casual administrator. These SEO features, however, can have a dramatic effect on how your DNN website is indexed by Google, Bing and others, and as such, can have an effect on your page rank and search results.

 

Here are a few DNN tips and tricks to help in your DNN’s SEO:

1. Site Map Priority

Buried within your page settings is a feature that allows you to set indexing priorities to your DNN pages. To get there (once logged in as an administrator), go to “page settings”, then “advanced settings”, then at the bottom of the window, go to “other settings”.

Here you will find the item: “Site Map Priority”. The default for this is .5. However, if your page is the home page, or perhaps a landing page, you will want to up the number to 1.0, or .9 (1.0 being the highest). This will increase the perceived importance of the page by search engines such as Google. Where is this relevant? When your organization appears in a Google search, high priority pages may be presented as sub-links to the home page more frequently. This can be critical in immediately directing visitors to key pages in an organic search result.

2. Site Settings

Here we’ll talk about one of things NOT to do when it comes to SEO in DotNetNuke. In the “site settings” of DotNetNuke, administrators have the ability to enter descriptions and keywords. By doing that, those items will then be placed in the META tags for EVERY page on the DNN website. For SEO, this is an extreme no-no, as it will confuse the search engines and reduce the relevancy and page rank of your overall DNN website. It may be an easy way to get keywords throughout your site… but it will definitely hurt you in the long run!

3. Page Titles

One of the nice features about DotNetNuke is its ability to add dashes between spaced words in your page title. For example, if you title a page “DNN SEO Tips”, DNN will title the actual URL as “DNN-SEO-Tips”. This ensures that the individual words in the title will be relevant to Google.
Some administrators like to use underscores between words. For example: “DNN_SEO_Tips”. This is strongly discouraged as Google will index the entire string as one item. This means people searching for DNN, or SEO or Tips will not see your site on Google. They would only find you if they specifically put “DNN SEO Tips”. In some cases this may be a good thing, if your content is very niche-oriented. But if you’re looking to gather visitors based on more broad searches, using underscores will hurt you.

4. Robots.txt

OK, this one gets a bit technical for the casual DotNetNuke administrator, but robots.txt is an important factor when comes to SEO, so what we’ll do in this section is give you enough information that you can intelligently go to your IT person or your hosting provider to ask questions.

In short, the robots.txt function (which not accessible via the administration tools in DNN), tells various search engines such as Google what pages to index and what pages they should not. Pretty important! But, if your DNN website is with a host provider and you are operating on a shared instance (one installation of DNN with many portals), you may be operating on one, centralized robots.txt file, which may be configured to tell the robots to ignore all pages on your site!

There is a way to take control and get around this, but it takes someone with access to the server and a bit of IT knowledge. But, don’t let that stop you from finding out if your robots.txt file is configured properly.

  • Ask your IT or host provider:
  • Is your DNN website on a shared instance?
  • Do you have an individual robots.txt file for your specific DNN website?

That’s it a few simple tools and information on how to squeeze more effectiveness with your DotNetNuke’s SEO. Hope useful.

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.



DotNetNuke Hosting - ASPHostPortal.com :: Easy Steps to Solve Problems logging in after upgrading DNN

clock Januarie 3, 2017 12:07 by author Dan

According to nwds-ak website. The information in this article applies to:

DotNetNuke - DNN
Upgrade Installation Options
DotNetNuke Upgrade Instructions -- DotNetNuke problems logging in after upgrade solution

If the DNN installation uses third-party modules that includes custom entries in the web.config file, the customer should consult with their vendor on the best way to perform an upgrade.

1. Rename the web.config file old_web.config

2. Extract DotNetNuke upgrade package


Now you need to extract all files from the DotNetNuke upgrade package into your root DNN folder or sub-folder if DNN is installed to a sub-folder. You will need to confirm the overwriting of your files. Once this process has completed, rename the release.config file to web.config and perform the following steps using the information from your old_web.config file

3. Update Connection Strings

Be sure that the proper connection strings are loaded for your setup, both in the <connectionstrings>and <appsettings> sections of your web config, examples are provided below.
<connectionStrings >
   
     < add  name ="SiteSqlServer" connectionString ="<yourconnectionhere>" providerName ="System.Data.SqlClient"  />
   connectionStrings >
   < appSettings>
     <!-- Database connection string (SQL Server 2000 or 2005 - kept for backwards compatability - legacy modules -->
     < add  key ="SiteSqlServer" value ="<yourconnectionhere>" />


4. Turn off AutoUpgrade

5. Copy Machine Key and Validation Key Values

Another very important item to copy over is your machine and validation keys from the old_web.config file. These are the keys used to encrypt and decrypt passwords and other information within your application. Failure to do this will result in your users including the admin and host user not being able to login. Below is an example of the machine key, the values you will be concerned with are the ones that note "<value to copy>".
<system.web >
     < machineKey  validationKey ="<value to copy>"  decryptionKey="<value to copy>"  decryption="3DES"  validation="SHA1"   />


6. Check and Update ObjectQualifer Line if necessarey

When Re-invent performs a free installation of DotNetNuke - DNN to a customers site we use an ObjectQualifer on line 321 in the web.config file before installation.   For example, if installing DNN v4 we change this line:

objectQualifier=""

to this:="DNN4"


7. Start Upgrade Process

After completing the above setup you are now ready to start the upgrade process.  You will want to delete your app_offline.htm file if you created one so that you can access your site again.  Now simply navigate to <yourSite>/Install/Install.aspx?mode=upgrade.  Once the page appears you should see a status screen that shows you the progress as the site is upgraded.  At the end you should see an upgrade complete message with a link to your portal.  You should not see ANY errors on this page, if you encountered an error be sure to note ALL information displayed so you can investigate the issues.

objectQualifier

This creates all SQL tables in the database with a Prefix of DNN4_.  This allows customers to differentiate between what tables are used for DotNetNuke and what tables are used for other applications you may have on your site.

You can check the ObjectQualifier by logging into your database to see if one was used.  If one was used you must change the ObjectQualifier line to match, otherwise leave it blank if no ObJectQualifer was used.

By default DotNetNuke will be set to "AutoUpgrade", this means that the first user to hit the default.aspx page on any portal within your DNN installation will trigger the upgrade process.  This is typically not a desired result as if an error occurs you might not be able to see the error log since the other individual started the upgrade.  The way around this is to update the "AutoUpgrade" appSetting, if you set this to "false" you will be required to navigate to the <yoururl>/Install/Install.aspx page to perform the upgrade.
<add  key ="AutoUpgrade"  value ="False"   />

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.



DotNetNuke Hosting - ASPHostPortal.com :: How To Improvement Performance in DNN

clock Desember 22, 2016 04:46 by author Armend

I have been seeing a big number of concerns not too long ago with regards to DotNetNuke functionality and items that will be done to help improve the overall performance in the internet site. Usually these questions surround the SiteLog and EventLog tables so I thought I'd post a number of simple queries which you can run to assist hold your database lean that will preserve your DotNetNuke website running at peak efficiency.

Website Log

I'll start off using the Internet site Log table, the website log functionality isn't a single that I truly utilize in my site, nonetheless for all those of you who use it in yours you are going to need to hold an eye on it, I have noticed that right after the log has grown to more than about 4-5 thousand records that you could begin to notice some efficiency decreases. Furthermore if you're like myself and have turned off the internet site log I found out that it will not necessarily clean itself up in case you turned it off, therefore in my case I had 1000 lingering records, which just unnecessarily improved the size of my database.

To check the amount of records within your Site Log use the following query

SELECT Count(*)
FROM SiteLog

To find the oldest record in the site log use the following

SELECT MIN([DateTime])
FROM SiteLog

Soon after you've viewed this details you can establish your necessary course of action. In my case since the internet site log is disabled on all portals I simply deleted all records in the table employing a basic delete statement. Within your case you could only want to purge certain records but that determination is outdoors the scope of this short article.

Event Log

The Occasion log shops portal certain event details like logins, invalid login attempts and actual errors. If you have a pretty active portal this table can grow very big really quickly. For my sites with their visitors of about 100-120 guests per day I have noticed an EventLog of over 2000 records within a two.five month period. Now unless you happen to be auditing logins or undertaking particular tracking you are able to normally rid yourself of those records without much impact. You'll be able to purge these portal by portal via the "Event Viewer" inside DotNetNuke, or it is possible to view and modify records by way of the database. Beneath I'll give you two valuable queries.

To determine the number of records, as well as the quantity of records per portal. Note, inside the benefits in the per portal query, you are going to discover a lot of entries listed having a NULL portal id, that is for DNN installation wide things, like scheduler and application events.

--Overall total
SELECT COUNT(*)
FROM EventLog

--Total by portal (null is not portal specific)
SELECT LogPortalId, COUNT(*)
FROM EventLog
GROUP BY logPortalId

To identify the oldest records you can use one of the following queries, again an overall minimum and a per portal minimum will be found

SELECT MIN(LogCreateDate)
FROM EventLog

SELECT LogPortalId, MIN(LogCreateDate)
FROM EventLog
GROUP BY logPortalId

Once again for deleting these records the decision truly depends upon your portals use on the Occasion Log and any require for user login auditing. In my case I once again don't require this details and at present I've resolved all of my routine errors that had been taking place, for that reason I removed all records in my listing across all sites. I try to complete this at the very least as soon as as month to ensure that the table size has been decreased.

Viewing DB Size

If you would like to view the size of one's database files you are able to make use of the query below to view the size of every single file for the present database.

SELECT *
from SYSFILES

Making use of these ideas you'll be able to start to acquire a better understanding of the database size and you can assist handle it and preserve your DotNetNuke website running at peak efficiency!

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 :: Tips To Integrate DNN with SharePoint 2013

clock Desember 15, 2016 05:25 by author Armend

DotNetNuke has already established itself as 1 from the most well-liked too as preferred net content management systems, primarily based on Microsoft. Net. DotNetNuke web sites are identified to provide outstanding user knowledge while also letting the brands enhance their identity. The current trend is the fact that of integrating this content material management system with that of Microsoft SharePoint, of which the newest version has not too long ago come out within the form of SharePoint 2013.


The integration is really valuable for the companies inside a number of methods. Right here is really a short overview of how the integration of DotNetNuke with SharePoint can be executed with accomplishment.

Powerful Document Management with SharePoint

SharePoint is undoubtedly probably the most preferred at the same time as even sought- after program for document management, helpful for businesses of varying size or nature. Now, this platform is constructed into cloud, which allows maximum storage and accessibility. Consequently, the experts in a group have an chance to share as well as collaborate on apparently massive amounts of data and documents. Moreover, the platform integrates efficiently with Outlook and this enables enhancement in the significance on the social tools. All this results in a very carefully organized atmosphere. The group members can also convert the raw data into critical interactive reports.

Integration of DotNetNuke with SharePoint

The top thing about integrating the web content management method together with the net application improvement platform is the fact that the two of them integrates quite seamlessly. An automatic integration implies that no additional efforts are essential when it comes to operating the method. The DNN Neighborhood can merge together with the platform inside a rather hassle- totally free manner by indicates of using the custom modules. The primary thought, here, is always to design and style a method that enables the platform to communicate from behind a firewall with all the folks facing the website. Now, all this implies that the documents could be pushed in to the portal around the DotNetNuke website with larger degree of safety and efficiency. Simultaneously, the filter rules can be made to track down the individual documents to discover as to exactly where they go.

DNN Enterprise and SharePoint Connector

In situations where the platform is utilized as the document management program, integration of the identical with DotNetNuke Enterprise Edition is really of real rewards. The custom integration saves a lot of income in the enterprise while investment that is produced is actually worthy.

The DNN Enterprise SharePoint connector comes up as a powerful and considerable function, supporting each 2007 and 2010 versions of the platform. The firewall problems can be avoided at the same time. Content, around the other hand, stays fresh and is published directly from the SharePoint Document Library. It is the DotNetNuke role- based security network that performs the crucial function of safeguarding the published documents.

Generating Use on the SharePoint Folder Provider

The SharePoint Folder is particularly beneficial in integration with DotNetNuke 6. It enables the DNN customers to store at the same time as synchronize the files contained inside the document libraries, located in 2010 version of this platform.

Here is an overview on the characteristics of this Folder as well as the way it aids:

The communication amongst the net application improvement platform and the DotNetNuke six becomes more rapidly and more direct by virtue from the folder. It paves the way for a number of providers to indicate to different document libraries from either the equivalent platform based internet sites or in the various ones.

The SharePoint Folder facilitates quite a few functionalities such as addition cum deleting of folders, uploading, downloading, renaming of files as well as synchronization of the files and folders. Above all, this Folder really acts as a powerful base for numerous DNN modules, which make use on the DotNetNuke file technique. Custom SharePoint development teams can help you build projects within allocated budgets and time schedules.

Best DotNetNuke Hosting Recommendation

ASPHostPortal.com is the leading provider of Windows hosting and affordable DotNetNuke Hosting. DotNetNuke Hosting from ASPHostPortal.com provides a safe, reliable and performance-driven foundation for your DotNetNuke website. DotNetNuke is the perfect Content Management System for managing and developing your website with one of ASPHostPortal’s Hosting plans. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability.



DotNetNuke Hosting - ASPHostPortal.com :: Easy steps to view error log exceptions in DotNetNuke

clock Desember 13, 2016 11:03 by author Dan

In this tutorial, you will learn how to view error log exceptions in DNN. You will also able to specify which log exceptions you want to record or ignore.

To view the error logs, you will need to have administrator portal access. Once you have login on the website, please go to the admin menu and you will see there is a menu called Event Viewer.

By default, all the error or event logs will be displayed on the site, you have an option to narrow the result list by specifying the log type by selecting one of the option in the dropdownlist.

How to turn off the event logs in DNN?

To turn off specific event logs in DNN is pretty simple, if you scroll further down, you will be able to see there is a button called Edit Log Settings.


To enable or disable the event log, click the pencil edit icon. This will load another window popup and there is a tickbox for you to untick it if you want to disable the event log.

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.



DotNetNuke Hosting - ASPHostPortal.com :: Tips To Remove .aspx from DNN

clock Desember 8, 2016 05:05 by author Armend

In this post I will expains how to remove .aspx from DotNetNuke URL, Lets check it out. DotNetNuke ships with a URL supplier that throughout the years has experienced a few overhauls by they way it can deal with URLs

 

Unique Method – Default.aspx?TabId=52

Second Version –/Home/TabId/52/Default.aspx

Human Friendly (Current Default) –/Home.aspx

The new human cordial is extraordinary yet obliges that the client attach the .aspx to the end of the page names.

Contextual analysis

Lets say you have a business card or advancement and you need to promote a particular page on your site that individuals could really sort in

"www.domain.com/promo"

Regularly what you would do is FTP into your DotNetNuke root index, make an organizer called promo and afterward make a default.htm page to divert to www.domain.com/promo.aspx

Reworking the URL

With IIS7 and Url Rewriting you can now add a few lines to your web.config record and handle urls without the .ASPX augmentation. The following is a sample of such a modify principle and you will put this within your hub.

<rewrite>
    <rules>
        <rule name="sanitize aspx">
          <match url="(^.*)" />
          <conditions logicalGrouping="MatchAll">
            <add negate="true" input="{REQUEST_FILENAME}" matchType="IsFile" />
            <add negate="true" input="{REQUEST_FILENAME}" matchType="IsDirectory" />
            <add input="{URL}" pattern="(.*).(.*)" negate="true" />
          </conditions>
          <action url="{R:1}.aspx" type="Rewrite" />
        </rule>
    </rules>
</rewrite>


This code lives up to expectations by first verifying that a document or index with the/promo does not as of now exist. On the off chance that it does then the physical record will overshadow the change guideline. Second it will then take the area url and add the .aspx to the end on the off chance that it doesn't exist. So when you write in/promo in the background it is serving up the page/promo.aspx. This is carried out without diverting or changing the url.

Presently all your URLs in DotNetNuke can be straightforward and considerably all the more beautiful.

Here is an option form in the event that you need to do 301 sidetracks to the page name versus revamping the url.

<rewrite>
    <rules>
        <rule name="sanitize aspx" stopProcessing="true">
          <match url="(^.*)" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            <add input="{URL}" pattern="(.*).(.*)" negate="true" />
          </conditions>
          <action type="Redirect" url="{R:1}.aspx" redirectType="Permanent" />
        </rule>
    </rules>
</rewrite>

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.



DotNetNuke Hosting - ASPHostPortal.com :: How To Build Webservice in DNN

clock Desember 1, 2016 07:32 by author Armend

I have recently been assigned to built a DotNetNuke web service to permit a windows application (or any sort of net client for instance) the flexibility to control DotNetNuke person accounts (create, change roles, delete, retrieve e mail address, and so forth.).


Since I had a tough time locating an accurate code sample or documentation that really applies to DotNetNuke  and accessing it without having being earlier logged in to DotNetNuke, it absolutely was difficult to constructed anything at all. I ultimately found out how to do it properly so I hard I would put my attempts to some use and write a blog publish explaining how you can get it done step by stage.


That said, let's begin by the fundamentals and just create a publicly available web services that permits anybody to ping the net service and acquire a pong again. For that we are going to use the new DotNetNuke 7 Providers Framework which makes it fairly simple should you know how to utilize it.

In order to create a net support that will work within DotNetNuke 7, you will need to fireplace up Visual Studio and create a class Library project (c# or VB but all illustrations listed here will be in c#).

That done, we will then reference some needed DotNetNuke 7 required libraries (making use of the Add Reference dialog box), here's the list:

DotNetNuke.dll
DotNetNuke.Web.dll
System.Net.Http.dll
System.Net.Http.Formatting.dll
System.Web.Http.dll

Then we also need to reference the System.Web class from the .NET tab of the same dialog box.

Finally, we neet to set the output path of the project to the DotNetNuke bin directory and we are ready to code.

Here is the code, the explanations follow:

using System.Net;
using System.Net.Http;
using System.Web.Http;
using DotNetNuke.Web.Api;
 
namespace MyService
{
    public class PingController : DnnApiController
    {
        [AllowAnonymous]
        [HttpGet]
        public HttpResponseMessage PublicPing()
        {
            return Request.CreateResponse(HttpStatusCode.OK, "Pong!");
        }
    }
    public class RouteMapper : IServiceRouteMapper
    {
        public void RegisterRoutes(IMapRoute mapRouteManager)
        {
            mapRouteManager.MapHttpRoute("MyService", "default", "{controller}/{action}", new[]{"MyService"});
        }
    }
}

  1. We merely start with some using statements for our needs as demonstrated previously mentioned
  2. We develop a namespace for our service and no matter what name we use listed here will be part of the url. I utilized MyService just for this instance but use any name which makes perception for your services.
  3. Now we create a public class for our controller. You'll be able to create numerous controllers if you want to and the controller is just a bunch of related actions that make feeling to group with each other. In my genuine project I have a PingController for testing functions, a UsersController for almost any steps that relate to user accounts and so forth. Just utilize a identify that makes feeling because it will even present up in the url. Two things for being careful right here:

    • The identify of one's controller should end using the term Controller but only what will come just before it will show inside the url, so for PingController, only Ping will show in the url route.
    • It should inherit DnnApiController so it'll use the DotNetNuke Providers Framework.
  4. Then we create the actual motion, inside our case, PublicPing. It's just a straightforward technique which return an HttpResponseMessage and may have a handful of characteristics. By default the brand new providers framework will respond only to host consumers and you also must explicitly enable other access rights if necessary, in this case the [AllowAnonymous] helps make this technique (or action if you prefer) obtainable to anyone with out credentials. The next attribute, [HttpGet] can make this action reply to HTTP GET verb, which can be usually used when requesting some date in the web server.
  5. Finally in that action, you insert whatever code you action needs to do, in this case just return the string "Pong!", just remember that you should return an HttpResponseMessage rather than a string or int or other item.

Ok so our controller and motion is done, now we just need to map that to an actual URL and that exactly what the final portion of the earlier code does. In essence this code tells DotNetNuke to map a specific url pattern for the techniques outlined in your course. You can use that code as is simply replacing MyService by no matter what your support title is.

Testing:

That is all there is certainly to it, your services is prepared! To test it, first compile it, then just navigate to http://yourdomain/DesktopModules/MyService/API/Ping/PublicPing and you should see "Pong!" inside your browser like a response.

Passing parameters

Ok, so the basic code above is working but it doesn't do anything useful. Lets add something more useful by creating an action that will give us the email address for a specific user id.

Again, here's the code and the explanations will follow (place the code inside the same namespace as the previous one):

public class UsersController : DnnApiController
    {
        [RequireHost]
        [HttpGet]
        public HttpResponseMessage GetEmail(int userid)
        {
            DotNetNuke.Entities.Users.UserInfo ui;
            ui = DotNetNuke.Entities.Users.UserController.GetUserById(PortalSettings.PortalId, userid);
            return Request.CreateResponse(HttpStatusCode.OK, ui.Email);
        }
    }

Initial we build a UsersController course which will hold all actions related to person accounts, it isn't completely required, you'll be able to have numerous steps within the same controller, nonetheless because this motion is not in any respect connected to our PingController, let'a create a new one more descriptive.

We then create a GetEmail motion (method) which will accept a userid parameter. The [RequireHost] parameter listed here will make it accessible only to host customers, we are going to see afterwards other authentication options.

The code inside the approach alone is fairly significantly self explanatory. The only interesting factor to notice listed here is the fact that because our course inherits DnnApiController, we already have a PortalSettings item obtainable. That is the big benefit of producing use of the DotNetNuke Solutions Framework. You'll have a ModuleInfo object to represent your module (if there is 1 using the identical identify as your support, which can be not essential such on this scenario), a PortalSettings object that signifies the portal at the domain title utilized to accessibility the support (portal alias) and at last a UserInfo item symbolizing the person that accessed the web services.

Testing:

If we now navigate to http://yourdomain/MyService/API/Users/GetEmail?userid=2 you need to receive the email tackle back again from the server unless of course obviously that userid does not exist, ensure that you check having a userid that truly exists for that portal. Should you exactly where not formerly linked having a host account, you then will probably be requested for qualifications.

Limiting access to particular roles

Alright, that actually works however, you need to give host qualifications to anyone needing to make use of your webservice. To avoid which you can change [RequireHost] by [DnnAuthorize(StaticRoles="Administrators")] which can limit access to administrators. Much better however, you nevertheless must provide them with an admin account. So the easy method to give only constrained entry would be to create a brand new role in DotNetNuke only for your internet services and substitute Administrators by that specific function title within the authentication parameter.

Utilizing HttpPost : (reply to a comment down bellow)

To answer Massod comment bellow, it's nearly exactly the same thing however, you have to develop an object to contain the posted information.
Let's make a easy ping that makes use of Submit, very first we need to create an object which will contain the posted info this sort of as:

public class FormMessage
    {
        public string Message { get; set; }
    }

Then we create the service method something like this:

public class PingController : DnnApiController
   {
       [AllowAnonymous]
       [HttpPost]
       public HttpResponseMessage PostPing(FormMessage formMessage)
       {
           return Request.CreateResponse(HttpStatusCode.OK, "Pong from POST: message was '" + formMessage.Message + "'.");
       }
   }

note that normally, a post would only return ok and no message, I am just doing this so we can test here.
Now since this is a POST verb, we can't test it by only using url parameters, we need to make an html file with a form to test it out. It would be someting like this:

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Untitled Pagetitle>
head>
<body>
    <form action="http://dnndev/DesktopModules/MyService/API/Ping/PostPing" method="POST">
        <label for="message">Message: label><input type="text" name="Message"/>
        <input type="submit" value="Submit"/>
    form>
body>
html>

The crucial thing to not right here is you can not just develop your Publish technique taking a string even when this can be only what you require, you do must create an object which will get your parameters.

Also never overlook that this is only for tests, you usually do not need to make this publicly accessible, you'd probably usually use yet another parameter than [AllowAnonymous] such as [DnnModuleAuthorize(AccessLevel = SecurityAccessLevel.View)] and [ValidateAntiForgeryToken] unless you truly want that for being public.

Best Recommended DotNetNuke Hosting

ASPHostPortal.com is the leading provider of Windows hosting and affordable DotNetNuke Hosting. DotNetNuke Hosting from ASPHostPortal.com provides a safe, reliable and performance-driven foundation for your DotNetNuke website. DotNetNuke is the perfect Content Management System for managing and developing your website with one of ASPHostPortal’s Hosting plans. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability.



DotNetNuke Hosting - ASPHostPortal.com :: Easy Steps To Set Google Gmail SMTP in DNN

clock November 28, 2016 10:17 by author Dan

According to bytutorial website, If you want to use Gmail SMTP in your DNN website, this can be easily done by specifying the correct port 587 in the SMTP settings. Unfortunately, there is no port number field supplied in the SMTP settings form. So in order to include the port number, you just need to add the smtp.gmail.com:587 in the SMTP settings.

In order to set the SMTP settings, you will need to login as super host account. Note this is a super administrator account so the basic administrator account will not get the access to the host menu. Under the host settings in the advanced settings tab, you will see a section for SMTP settings. You just simply need to use the following settings. Just replace the email and password of your own.

Best Recommended DotNetNuke Hosting

ASPHostPortal.com is the leading provider of Windows hosting and affordable DotNetNuke Hosting. DotNetNuke Hosting from ASPHostPortal.com provides a safe, reliable and performance-driven foundation for your DotNetNuke website. DotNetNuke is the perfect Content Management System for managing and developing your website with one of ASPHostPortal’s Hosting plans. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability.



DotNetNuke Hosting - ASPHostPortal.com :: Tips To Resolve Script Error in DNN

clock November 24, 2016 07:13 by author Armend

If you’ve made the transition from DotNetNuke 6 to DotNetNuke 7 you’ve probably discovered that the AJAX Toolkit controls don’t play nice with DotNetNuke any more.  Fortunately the Telerik AJAX controls have been bundled with DotNetNuke for version 7.  I’ve discovered that converting to the Telerik controls has been beneficial and worth the upgrade.
Still, it can be a pain getting the code right.  One particular error that I ran into today was the Registered Script Control error.  It looks something like this:

"Script control ‘{controlname}’ is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().  Parameter name: scriptControl"

The error results from “stacked” AJAX controls.  Consider the following HTML

<%@ Register TagPrefix=”dnnui” Namespace=”DotNetNuke.Web.UI.WebControls” Assembly=”DotNetNuke.Web” %>
<%@ Register TagPrefix=”DNN” Namespace=”DotNetNuke.UI.WebControls” Assembly=”DotNetNuke.WebControls” %>
   <DNN:DNNTabStrip ID=”tabsProject” runat=”server” TabRenderMode=”All” Visible=”true”>
     <DNN:DNNTab runat=”server” Label-Text=”Properties” ID=”tabGeneral”>
       <dnnui:DnnAjaxPanel runat=”server” ID=”dapMain”>
         <asp:Label runat=”server” ID=”lblInfo”></asp:Label>
       </dnnui:DnnAjaxPanel>
   </DNN:DNNTab>
     <DNN:DNNTab runat=”server” Label-Text=”Properties” ID=”tabSecond”>
       <dnnui:DnnAjaxPanel runat=”server” ID=”dapSecond”>
         <asp:Label runat=”server” ID=”lblMessage”></asp:Label>
       </dnnui:DnnAjaxPanel>
   </DNN:DNNTab>
      </DNN:DNNTabStrip>

Let’s say that the second tab (tabSecond) should only appear under certain conditions; a record was created, a particular user is logged, whatever the condition is doesn’t matter, just that the tab should appear at certain times and not appear at other times.
In the code behind the condition block might look like this:

if (condition) then
tabSecond.Visible = False
end if

But this results in the Registered Script Control error.  Modify the condition block this way:

if (condition) then
dapSecond.EnableAJAX = False
tabSecond.Visible = False
end if

This should resolve the error

What was the issue?  I’m glad you asked.
The issue causing the error is that AJAX controls are registered with the AJAX script manager and cannot be unregistered, or moved.  Hiding an AJAX control is equivalent to moving it from the script.  In order to circumvent that we’re disabling AJAX on the control before it has a chance to be rendered and registered with the script manager.

Best Recommended DotNetNuke Hosting

ASPHostPortal.com is the leading provider of Windows hosting and affordable DotNetNuke Hosting. DotNetNuke Hosting from ASPHostPortal.com provides a safe, reliable and performance-driven foundation for your DotNetNuke website. DotNetNuke is the perfect Content Management System for managing and developing your website with one of ASPHostPortal’s Hosting plans. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability.



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