how to Usercontrol multiple instances on page with common javascript functionality

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anirudha d
    New Member
    • Feb 2011
    • 4

    how to Usercontrol multiple instances on page with common javascript functionality

    I am having user control multiple instances on same page. user control is embeded with javascript functionality.

    for eg.

    <script type="text/javascript" language="javas cript">

    var Global_variable 1,Global_Variab le2;



    function CommonFunction( ){
    }

    </script>

    i am calling this function from .ascx.cs like this


    Me.Page.ClientS cript.RegisterS tartupScript(Me .GetType(), "FunctionCall", "commonfunction ();");


    when in .aspx page (i,.e in parent page ) multiple instances of the user control are loaded then it get override by 1st user control instance

    i want all global variables & commonfunction( ) to be called for each instacne of user control
    For ex. Usercontrol1,us ercontrol2 are two instances in the parent page
    then function should get called as Usercontol1.Com monFucntion(),U sercontrol2.com monFunction()

    For global variables UserControl1.Gl obalVariable1,U sercontrol2.Glo balvariable1 etc

    How to do this .please help me
Working...