Solved

calling user control method from parent page

Posted on 2009-05-05
3
555 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
tetorvik earned 125 total points
ID: 24311295
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
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"
0
 
LVL 9

Expert Comment

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

as you use "custom" as a TagPrefix
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

717 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