Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

calling user control method from parent page

Posted on 2009-05-05
3
Medium Priority
?
570 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 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month20 days, 20 hours left to enroll

810 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