Friday, May 2, 2014

Telerik RADEditor Renders Incorrectly When Shown with AJAX

While I am sure this isn't a common problem, I am also sure that I could not be the only one that encountered it. So hopefully the solution below comes to someone's benefit in the future.

I had a RADEditor placed in a panel that was at load-time initially hidden, using server-side code. This means that the RADEditor was never rendered. At a later point, when the user kicked off an event, the server-side code made the panel "visible". Normally this would be an issue, however all this happened using AJAX, in my attempt to speed up page processing and avoid full postbacks.

Well...talk about unexpected results. The first time the RADEditor rendered through an AJAX partial-postback, the RADEditor ended up rendering strangely. In my case, the height was way larger then it should have been, causing it to overlap the controls directly beneath it. Changing the views on the bottom cause the control to immediately snap to the correct height, or if I cause another AJAX partial-postback, it would then render correctly. Obviously this is a problem because end-users would not like or know that those things would fix the problem. End-users want it to work the first time.

Ended up that because the RADEditor didn't render on the initial page-load, the corresponding CSS files were not loaded. When the AJAX partial-postback occurred, it loaded the CSS files, but not in time to the RADEditor to make use of them, causing some unexpected rendering. I figured out which CSS files were missing and forced them to load (using server-side code) at the time of initial page-load. This way, the first time the RADEditor is rendered, the CSS file were already loaded and available to complete the rendering process. Below is the code I used for server-side loading.

Tuesday, January 14, 2014

Implementing SSO w/ DNN and SmarterTrack

So this I have to admit had me spinning my wheels for a while, but I finally figured it out. So below is a step-by-step guide on how to implement SSO using DNN as the main login site, and SmarterTrack as a secondary site that authenticates using the DNN login.

Requirements: Please note that in order for SSO to work "out-of-the-box" so to speak is that both site must be on the same domain. (ie: www.mydomain.com & support.mydomain.com) If the domains are different this method will not work and you will have to implement a custom SSO scenario.

Note: This write-up was performed on DNN 06.02.09 and SmarterTrack 9.5

  1. Open up the web.config files from both DNN and SmarterTrack sites.
  2. Copy the entire "machineKey" tag line from the DNN web.config and paste it into the SmartTrack web.config.
  3. In both web.config files add the following parameters to the end of the "forms" tag:   domain="MyDomain.com" enableCrossAppRedirects="true"
  4. In the SmarterTrack web.config add the following to the beginning of the "forms" tag:
    name=".DOTNETNUKE"
  5. Log into your SmarterTrack site as the administrator
  6. Click the settings icon.
  7. In the navigation pane - Navigate to System Settings > Setup > External Providers
  8. In the options tab check "Enable login provider".
  9. Click the "Login" tab which is now available and enter the following information:
    Note: Replace www.MyDomain.com with your DNN domain
    Web Service URL: http://www.MyDomain.com/login.aspx
    Web Service Password: [Leave This Blank]
    Forgot Password URL: [Copy The Link From Your Login Page's 'Retrieve Password' Link]
    Select a default role for users
  10. Check "Enable single sign-on cookies from other sites".
  11. Click save.

Congratulations, you have successfully setup SSO between DNN and SmarterTrack.

Note that you have to have a matching User in SmarterTrack with the same UserName as found in DNN for SSO to work, otherwise you will get an error. So may have to manually create SmarterTrack usernames to match DNN accounts.