Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModules$.dnnAlert don't work in DNN7$.dnnAlert don't work in DNN7
Previous
 
Next
New Post
1/9/2014 10:30 AM
 

Hello everybody.

I am facing the following problem:

I put the following script code

<script type="text/javascript"> 
    function ShowPopUpDialog(message)
    {
        $.dnn
            {
                okText: 'CLOSE',
                text: '<div id="idpopup"> <span class="centraliza">' +  message + '</span></div>',
                title: 'Aviso'
            });
    };
</script>

And the Code Behind:

            protected void Page_Load(object sender, EventArgs e)
            {
                PopMessageBox("Teste");
            }



            private string getCode(String message)
            {
                StringBuilder sb1 = new StringBuilder();
                sb1.AppendLine("ShowPopUpDialog('" + message + "')");
                return sb1.ToString();

            }

            public void PopMessageBox(String message)
            {
                ScriptManager requestSM = ScriptManager.GetCurrent(Page);
                if (requestSM != null && requestSM.IsInAsyncPostBack)
                {
                    ScriptManager.RegisterStartupScript(this, typeof(Page), Guid.NewGuid().ToString(), getCode(message), true);
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(typeof(Page), Guid.NewGuid().ToString(), getCode(message), true);
                }
            }

If I'm logged in with 'Super User Account', it works well. But if I'm not logged in or logged in with others accounts, it don't work.

Using DNN6 worked perfectly.

Anyone have any idea what could be the problem?

 

 
New Post
1/11/2014 5:54 PM
 

You need to make sure you tell DNN that you want to use jquery elements in your module.  Otherwise DNN will ONLY activate them if it needs them itself - it does this automatically when you are logged in as a super user - so that all the admin function operate ... when you are NOT logged in as admin however these tools are NOT automatically loaded.

Try adding the following 3 lines of code at the start of you Page_Load method.
    DotNetNuke.Framework.JavaScriptLibraries.JavaScript.RequestRegistration(DotNetNuke.Framework.JavaScriptLibraries.CommonJs.jQuery);  DotNetNuke.Framework.JavaScriptLibraries.JavaScript.RequestRegistration(DotNetNuke.Framework.JavaScriptLibraries.CommonJs.DnnPlugins);
DotNetNuke.UI.Utilities.ClientAPI.RegisterClientReference(this.Page, ClientAPI.ClientNamespaceReferences.dnn);

They tell dnn to turn on jquery, turn on the dnnplugins and register the dnn client site api references.

Westa

 
New Post
1/17/2014 9:38 PM
 
It worked perfectly

It's what I always say:


"Ask anyone who knows"

Thank you very so much (Muitíssimo obrigado!!!)

Netto.
(from Brasil)

 
New Post
5/29/2014 4:30 PM
 
Hi Wes Tatters
I am using the 07.02.01 DNN Version

If I'm logged in with 'Super User Account', it works well. But if I'm not logged in or logged in with others accounts, it don't work.

I try adding the following 3 lines of code at the start of the Page_Load method.
DotNetNuke.Framework.JavaScriptLibraries.JavaScript.RequestRegistration(DotNetNuke.Framework.JavaScriptLibraries.CommonJs.jQuery); DotNetNuke.Framework.JavaScriptLibraries.JavaScript.RequestRegistration(DotNetNuke.Framework.JavaScriptLibraries.CommonJs.DnnPlugins);
DotNetNuke.UI.Utilities.ClientAPI.RegisterClientReference(this.Page, ClientAPI.ClientNamespaceReferences.dnn);

and DotNetNuke.Framework. hasn`t a JavascriptLibraries class

DotNetNuke.UI.Utilities. hasn`t a ClientAPI class

I added these 2 lines but still not working:
jQuery.RequestRegistration();
jQuery.RegisterScript(this.Page);


 
New Post
5/29/2014 4:43 PM
 

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModules$.dnnAlert don't work in DNN7$.dnnAlert don't work in DNN7


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out