Hi,
yeah you can maintain single javascript function for multiple ascx files
but you've to maintain different ids for controls used in ascx control
<uc1:webusercontrol id="WebUserControl1" runat="server" xmlns:uc1="#unknown" />
<br />
<uc2:webusercontrol2 id="WebUserControl21" runat="server" xmlns:uc2="#unknown" />
<input type ="button" id="btnpage1" value ="testingoncontrol1" onclick ="showmypop(this.id)" />
Here i'm providing some example for using same javascript function in different ascx files
code under Wenusercontrol1
<input type ="button" id="btnpage2" value ="testingoncontrol2" onclick ="showmypop(this.id)" />
code under Wenusercontrol2
<input type ="button" id="btnpage3" value ="testingoncontrol3" onclick ="showmypop(this.id)" />
And finally the javascript method must be exists in aspx page
aspx script file contains following method
function showmypop(tid) {
alert(document.getElementById(tid).value);
}
I hope you understood what I said.
all the Best.