<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl3.ascx.cs" Inherits="CaseTest.CaseTest.WebUserControl3" %>
<script type="text/javascript">
function pageLoad(sender, e)
{
alert("1234");
}
pageLoad();
</script>
<asp:TextBox ID="TextBox1" runat="server" Text =" Control in user control"></asp:TextBox>
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
243 Points
156 Posts
pageLoad() isn't fired
Feb 26, 2018 12:00 PM|anooshiravan|LINK
hi
I have an *.ascx user control and have a pageLoad function for it:
It is rarely fired as I refresh the page so many times event using Ctrl + F5
what could be the problem?
thanks in advance.
All-Star
53631 Points
23987 Posts
Re: pageLoad() isn't fired
Feb 26, 2018 02:25 PM|mgebhard|LINK
Did you include the ASP scriptmanager in the master or client page?
https://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager(v=vs.110).aspx
Member
243 Points
156 Posts
Re: pageLoad() isn't fired
Feb 27, 2018 05:17 AM|anooshiravan|LINK
yes I have included that tag.
Star
8670 Points
2882 Posts
Re: pageLoad() isn't fired
Feb 27, 2018 06:20 AM|Cathy Zou|LINK
Hi anooshiravan
You should call pageload function,
code as below:
Output:
Best regards
Cathy
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.