I have an issue for ASP.net user control
Let's say for Example that I have a Main Page with two user control inside.
The Page consist of
Main Page : Survey.aspx
UserControl1 : RadioButton.ascx
UserControl2 : CheckBox.ascx
In both User Control, I added a specific Javascript to assist for both CSS functions.
The issue is, When I ran the Survey Page, let say that I load for RadioButton first, and then Checkbox second. The javascript added in Checkbox does not load in Browser. Only Javascript for RadioButton. The same goes vice versa when Checkbox is load first and then RadioButton load second.
When i inspect in the source page for Survey.aspx, it seems that the Javascript from the second loaded User Control is not registered in the Page. I have also tried to load the Javascript all in The Main Page, but failed to do so. Cannot call the specific functions inside every User Control
The user control is binded through repeater events for ASP.NET
If you have any ideas, please let me know. thanks in advance.
In Survey.aspx
<asp:Repeater runat="server" ID="rptQuestion">
<ItemTemplate>
<uc:CheckBox ID="ucCheckBox" runat="server" Visible="False">
<uc:RadioButton ID="ucRadioButton" runat="server" Visible="False">
</ItemTemplate>
</asp:Repeater>
In ucCheckBox.ascx
<script type="text/javascript">
function checkchange(){
--some function---
}
</script>
In ucRadioButton.ascx
<script type="text/javascript">
function radChange(){
--some function--
}
</script>
So if I load checkbox first
In source file in Browser only exist javascript in checkbox, no javascript from radiobutton usercontrol