Returning a value from an ASCX function

Posted on 2007-07-24
Last Modified: 2007-07-24
Using ASP.NET 1.1 (VB), is it possible for a container ASPX page to execute a Function within a user control (ASCX.VB)  and capture the returned value?
Question by:RichardKline
    LVL 16

    Accepted Solution

    Yes, simply define the function in your ascx's vb file as public and then in your aspx page's code behind, obtain a reference to the control and call it's function just like any other function:

    Dim ctrl As New MyCustomControl

    Response.Write(ctrl.MyFunction(param1, param2))
    LVL 1

    Author Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Suggested Solutions

    Title # Comments Views Activity
    Add json string to a javascript object 9 33
    Visual Studio 2013 Publish 13 30
    401 - Error 6 11
    send mail from 8 9
    Foolproof security solutions has become one of the key necessities of every e-commerce or Internet banking website. If you too own an online shopping site then its vital for you to equip your web portal with customer security features that can allow…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde… provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
    Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

    737 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

    18 Experts available now in Live!

    Get 1:1 Help Now