Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > How to add java script in new Document type, New transformation? View modes: 
User avatar
Member
Member
Harish - 5/7/2010 1:44:31 AM
   
How to add java script in new Document type, New transformation?
Hi to all,
I want add java script in new Document type-New transformation. How I can do this.

Why I need java script means, When I mouse over on the element I need to java script for my custom use. we need to add in JS file or any option for this. Because once I export this document type it will comes as package. So, in other system I used import that. That java script must work in that system to. Don't want to do again JS configurations. What is the best way?

Please help me..!

Thanks,
Naga Harish.

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 5/7/2010 2:53:25 AM
   
RE:How to add java script in new Document type, New transformation?
Hi,

you can use following approach to register your javascript in transformation:

<script runat="server">
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
this.Page.ClientScript.RegisterClientScriptBlock(typeof(string), "uniquevalue", "document.write('test');", true);
}
</script>


I hope this will help you.

Best regards,
Miroslav Remias.