2

I am trying to show a jQuery modal popup in my custom dnn module and for it I used below code which works fine.

<div id="dialog-form" title="Notices">
    <div>
        My Notice 1
    </div>
</div>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" />
<script type="text/javascript">
    $(document).ready(function () {
        $("#dialog-form").dialog({
            modal: true,
            buttons: {
                Close: function () {

                    $(this).dialog("close");
                }
            }
        });
    });
</script>

My concern is that in above code I have referred to jQuery UI file directly using link tag and I know that DNN ships with jquery UI files itself. So there must be some way to avoid referencing UI css file directly and using what dnn already comes with.

I have tried using below lines in my modules code behind but none of them worked for me

DotNetNuke.Framework.jQuery.RequestUIRegistration();
JavaScript.RequestRegistration(CommonJs.jQueryUI);  //obsolete in DNN7.2

I also tried method mentioned at below link http://www.ifinity.com.au/Blog/EntryId/121/Using-jQuery-UI-with-DotNetNuke-5-and-6-in-the-same-module

TechnicalSmile
  • 1,387
  • 5
  • 16
  • 30

1 Answers1

0

In order to register jquery and jquery UI you should call:

using DotNetNuke.Framework.JavaScriptLibraries;
//...

JavaScript.RequestRegistration(CommonJs.jQuery);
JavaScript.RequestRegistration(CommonJs.jQueryUI);
Trapias
  • 94
  • 1
  • 7
  • I have mentioned in my question I already tried that and it didn't worked for me. Also I get warning "obsolete in DNN7.2" – TechnicalSmile Oct 15 '14 at 13:35
  • @TechnicalSmile I'm on 7.3 and those methods are not obsolete... do you have a clean install? Tried upgrading? – Trapias Oct 15 '14 at 14:06
  • I was creating then for 7.2. Obsolete warning is secondary thing, my problem was it plain didn't worked. I added this line in page_load of my custom control and still I had to add this in my ascx – TechnicalSmile Oct 15 '14 at 14:15