Calling another subroutine

Discussion in 'ASP .Net' started by sck10, Aug 15, 2005.

  1. sck10

    sck10 Guest

    Hello,

    How do you reference a sub that uses CommandEventArgs from another sub? For
    example, I would like to call the sub "EmployeeOld_Click" from "Call_MySub".

    Sub Call_MySub()
    Call EmployeeOld_Click(Something here, Something here)
    End Sub


    Sub EmployeeOld_Click(ByVal Src As Object, ByVal Args As CommandEventArgs)
    Me.pnlEmployeeNew.Visible = True
    End Sub

    --
    Thanks in advance,

    sck10
    sck10, Aug 15, 2005
    #1
    1. Advertising

  2. sck10

    Andrea Zani Guest

    sck10 <> ha scritto:
    > How do you reference a sub that uses CommandEventArgs from another
    > sub? For example, I would like to call the sub "EmployeeOld_Click"
    > from "Call_MySub".
    >
    > Sub Call_MySub()
    > Call EmployeeOld_Click(Something here, Something here)
    > End Sub
    >
    >
    > Sub EmployeeOld_Click(ByVal Src As Object, ByVal Args As
    > CommandEventArgs) Me.pnlEmployeeNew.Visible = True
    > End Sub


    Sub Call_MySub()
    EmployeeOld_Click(nothing,nothing)
    End Sub

    --
    AZ [Microsoft - .NET MVP]
    Mia Home page: http://ciclismo.sitiasp.it
    Asp.Net community: http://www.aspitalia.com
    Il mio blog: http://blogs.aspitalia.com/az
    Andrea Zani, Aug 15, 2005
    #2
    1. Advertising

  3. sck10

    billrob458 Guest

    Since it appears you are not using the CommandEventArgs parameter in
    your EmployeeOld_Click method, you can call it passing empty
    parameters.

    Sub Call_MySub()
    EmployeeOld_Click Nothing, EventArgs.Empty
    End Sub

    HTH,

    bill

    sck10 wrote:
    > Hello,
    >
    > How do you reference a sub that uses CommandEventArgs from another sub? For
    > example, I would like to call the sub "EmployeeOld_Click" from "Call_MySub".
    >
    > Sub Call_MySub()
    > Call EmployeeOld_Click(Something here, Something here)
    > End Sub
    >
    >
    > Sub EmployeeOld_Click(ByVal Src As Object, ByVal Args As CommandEventArgs)
    > Me.pnlEmployeeNew.Visible = True
    > End Sub
    >
    > --
    > Thanks in advance,
    >
    > sck10
    billrob458, Aug 15, 2005
    #3
  4. it would be cleaner to move the code within EmployeeOld_Click to a common
    function and call the common funtion from both EmployeeOld_Click and
    Call_MySub... my 0.02$

    "sck10" wrote:

    > Hello,
    >
    > How do you reference a sub that uses CommandEventArgs from another sub? For
    > example, I would like to call the sub "EmployeeOld_Click" from "Call_MySub".
    >
    > Sub Call_MySub()
    > Call EmployeeOld_Click(Something here, Something here)
    > End Sub
    >
    >
    > Sub EmployeeOld_Click(ByVal Src As Object, ByVal Args As CommandEventArgs)
    > Me.pnlEmployeeNew.Visible = True
    > End Sub
    >
    > --
    > Thanks in advance,
    >
    > sck10
    >
    >
    >
    =?Utf-8?B?U3JlZWppdGggUmFt?=, Aug 15, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. asadikhan
    Replies:
    2
    Views:
    3,655
    =?Utf-8?B?SG1udA==?=
    Apr 25, 2004
  2. Bigdakine

    Calling fortran subroutine from c

    Bigdakine, Sep 1, 2004, in forum: C Programming
    Replies:
    13
    Views:
    647
    Mark L Pappin
    Sep 25, 2004
  3. Amit

    Calling subroutine in fortran module

    Amit, Jan 30, 2005, in forum: C Programming
    Replies:
    5
    Views:
    1,607
    Dave Thompson
    Feb 7, 2005
  4. buran

    calling a subroutine in datalist edit mode

    buran, Sep 8, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    131
    buran
    Sep 8, 2003
  5. king
    Replies:
    5
    Views:
    178
Loading...

Share This Page