Solved

calling user control method from parent page

Posted on 2009-05-05
3
512 Views
Last Modified: 2012-08-14
May i  know how to call a public method of user control from aspx code behind using vb.net please .
0
Comment
Question by:nagdotnet
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
tetorvik earned 125 total points
Comment Utility
See below, hope it helps.
User Control declaration on parent page:

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

    <div>

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

    </div>

    </form>
 

Public Function in MyUserControl.ascx.cs:

    Public Function MyFunction() As Boolean

        Return True

    End Function
 

Function call from parent page:

MyUserControl1.MyFunction()

Open in new window

0
 

Author Comment

by:nagdotnet
Comment Utility
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"
0
 
LVL 9

Expert Comment

by:tetorvik
Comment Utility
use
<custom:LinkPager ID="LinkPager1" runat="server"/>

as you use "custom" as a TagPrefix
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 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

11 Experts available now in Live!

Get 1:1 Help Now