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...Getting StartedGetting StartedRegister style sheet and Javascriot/JqueryRegister style sheet and Javascriot/Jquery
Previous
 
Next
New Post
4/11/2010 2:09 AM
 

 Hi all Dnn Experts,

I am looking for a solution, please help me, I am quite new to DNN and facing some issues.

I've a Website which i need to migrate in DNN, for that I had converted some of my existing page to user control and installed as a module.

Problem arise when the CSS class and JavaScript come into picture, because .ascx page don't have any header section, then how can i register my css class and where i put my Java Script code.

I've found several solutions for css, like create a module.css in the same folder where module resides and DNN will load the style sheet automatically.

But it doesn't seem to work, Please help me on this, I've my own module and how can i put css on this module.

 Another issue regarding Javascript/Jquery, I am using Jquery for different purpose like calling a page method, and some are for document.ready function like:

$(document).ready(function() {

$("*[id^=EditFeeds_]").hide();

$("[id$='errorLabel']").innerHTML = "";

}); 

and also

<script type="text/javascript">

        $(document).ready(function() {

            try {

                $.ajax({

                    type: "POST",

                    url: "newsDemo.aspx/preRender",

                    data: "{}",

                    contentType: "application/json; charset=utf-8",

                    dataType: "json",

                    success: ajaxCallSucceed,

                    failure: ajaxCallFailed

                });

            }

            catch (e) {

                window. 'Data can not be inserted, please verify inputs');

            }

        });

 

        function ajaxCallSucceed(response) {

            $('#ResultDiv').html(response.d);

            $('*[id^=ItemDiv_]').slideUp();

            $('div').filter(function() { return this.id.match("ItemDiv_\\d_1"); }).slideDown();

 

            //  $("toggle_ItemDiv_1").attr("src", "images/tall-up-arrow.gif");

            //            document.getElementById('toggle_ItemDiv_1').src = ""

 

            return false;

        }

 

 

        function ajaxCallFailed(error) {

            window. 'Data can not be inserted, please verify inputs');

        }

 

    </script>

 

Please tell me how can i add such functionality i dnn module, because jquery fires on document.ready event and execute before control lod.

 

Please help me, I am in a very bad situation and need your help, Please describe your solution little because bit more, I am new in dnn.

 

Please help, and let me know if any clarification reqired.

Thanks

Appwriters

 

 
New Post
4/12/2010 10:17 AM
 

For CSS, you have the Module.css option as you mention, just be sure to include it in your .dnn manifest file as a file, and it will automatcally be taken care of for you.

For the registering of scripts you have a number of methods.  Joe Brinkman has a blog post about a way of doing it, you can also use the ClientScript.RegisterClientScriptBlock method, which is a standard ASP.NET way to do thing to get content out there.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting StartedRegister style sheet and Javascriot/JqueryRegister style sheet and Javascriot/Jquery


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