Firing a method on remote code

Posted on 2007-07-20
Last Modified: 2010-04-15
I have a suer control on my default.aspx page. On the OnCommand event in my user control i want to fire a specific method on the default.aspx.cs code behind...

Is this possible without putting some sort of logic in the pagload event of the default page?

can i use properties or something?

Question by:Nugs
    1 Comment
    LVL 13

    Accepted Solution

    if the method is a member of Page class, you can call it from your control just use Page property within your control.
    if the method is not a member of Page class, you have two options:
    1) create a basepage inherited from Page and add your method.
        make default.aspx page inherited from your base page instead of Page. Then in your control cast the Page to basepage and call the method
    2) define a delegate in your user control, in your default page associate the method with the delegate  , then in your user control call the delegate.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Suggested Solutions

    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    734 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

    24 Experts available now in Live!

    Get 1:1 Help Now