calling user control method from parent page

Posted on 2009-05-05
Last Modified: 2012-08-14
May i  know how to call a public method of user control from aspx code behind using please .
Question by:nagdotnet
  • 2

Accepted Solution

tetorvik earned 125 total points
ID: 24311295
See below, hope it helps.
User Control declaration on parent page:

    <form id="form1" runat="server">


        <uc1:MyUserControl ID="MyUserControl1" runat="server" />



Public Function in MyUserControl.ascx.cs:

    Public Function MyFunction() As Boolean

        Return True

    End Function

Function call from parent page:


Open in new window


Author Comment

ID: 24311328
i  have only
<%@ Register Src="~/LinkPager.ascx" TagName="LinkPager" TagPrefix="custom" %>
in my aspx page , but i added now
<uc1:LinkPager ID="LinkPager1" runat="server" />

But i am getting compile error "Unknown server Tag uc1:LinkPager"

Expert Comment

ID: 24311358
<custom:LinkPager ID="LinkPager1" runat="server"/>

as you use "custom" as a TagPrefix

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
javascript window.createPopup() not working in chrome but works in IE browser 3 113 mvc input file 2 32
LINQ - C# to VB convertion 12 48
Tool Box 2 35
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: (…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now