|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
UserControl loaded dynamically multiple times on same page....client js problemOK - I have a user control that I have written. I load it multiple
times on the same page with different data. It uses a server side javascript file that contains some DHTML / JS. The problem appears to be that since each instance of the control shares the same .JS file, there appears to be collisions where one control is overwriting values in the .JS that was set by the other control. Is there some way to have each user control have its own instance of the same JS file? Any help greatly appreciated! hi, this is basically a scripting issue, that you should try and resolve in
your js. Your js needs to be able to deal with multiple elements calling and using the same piece of code while preserving scope. Try an object oriented approach in you way of writing js code, this way for each element you can instiantiate a new object with the new operator, and each call will run within its own scope. Currently your code seems to be running within a global scope, so its normal that they override values, specially if you have some variables declared outside your functions these run in globalscope and are probably the root cause of the problem you are having. Regards, Alessandro Zifiglio http://www.AsyncUI.net <ib***@ibejo.com> ha scritto nel messaggio Show quoteHide quote news:1152756615.692252.239200@35g2000cwc.googlegroups.com... > OK - I have a user control that I have written. I load it multiple > times on the same page with different data. It uses a server side > javascript file that contains some DHTML / JS. The problem appears to > be that since each instance of the control shares the same .JS file, > there appears to be collisions where one control is overwriting values > in the .JS that was set by the other control. > > Is there some way to have each user control have its own instance of > the same JS file? > > Any help greatly appreciated! >
Setting Properties in a Composite Control...
Repeater and text boxes inside how to change labelvalue when deleting row in gridview? Programmatically listening for an event? Can't install iewebcontrols.msi - error "webctrl_client is unavailable" Multi-line textbox scrolled to bottom? Problem handling event in a button inside a Datalist menu control with XML file passing variable to sql statement in asp.net 2.0? creative scroll bar for asp.net |
|||||||||||||||||||||||