Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > User control multiple instances in page + common javascript functionality

Reply
Thread Tools

User control multiple instances in page + common javascript functionality

 
 
Anirudha24.d Anirudha24.d is offline
Junior Member
Join Date: Feb 2011
Posts: 3
 
      02-08-2011
I am having user control multiple instances on same page. user control is embeded with javascript functionality.

for eg.

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

var Global_variable1,Global_Variable2;



function CommonFunction(){
}

</script>

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


Me.Page.ClientScript.RegisterStartupScript(Me.GetT ype(), "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,usercontrol2 are two instances in the parent page
then function should get called as Usercontol1.CommonFucntion(),Usercontrol2.commonFu nction()

For global variables UserControl1.GlobalVariable1,Usercontrol2.Globalva riable1 etc

How to do this ?.please help me



Thanks & Regards,

Anirudha Deshpande
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How Can I use multiple instances of the same custom control on an ASP.NET Page? Pradeep Mareddi ASP .Net Web Controls 1 08-30-2004 06:50 PM
Creating multiple instances of a Web User Control. Phobos ASP .Net Web Controls 0 08-16-2004 06:41 AM
Guru's Challenge: How to place multiple instances of a control in a single page in an abnormal situation .Net Newbie ASP .Net Datagrid Control 0 07-29-2004 04:38 PM
Problem adding multiple instances of a custom control to aspx page Owen Evans ASP .Net Web Controls 9 06-10-2004 07:57 PM
list of class instances within a list of a class instances John Wohlbier Python 2 02-22-2004 08:41 AM



Advertisments