Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default what is EventArgs

    Hi,
    in any event procudure,there is two paras:sender As Object, e As EventArgs,
    i copied them-not know what they are about, and my ASPX works.

    I guess the sender is the control by which I triggered this sub, and what is
    EventArgs then?

    I am passing a third para to the sub, that is mysub("jim",sender As Object,
    e As EventArgs),
    the sub is defined like :
    mysub(ByVal Nickname as string,sender As Object, e As EventArgs)
    if nickname="jim" then
    sdfsdfsd
    end if
    end sub
    but when I call mysub("jim",sender As Object, e As EventArgs),, it said I
    provided nothing about eventargs.
    when I call mysub("jim"), it doesn't work too.

    THe sub is a event sub, triggered by a clicking a button.

    Can any one give me a hit ?

    Thanx
    Yangtsi River




    Yangtsi River Guest

  2. Similar Questions and Discussions

    1. What does (ByVal sender As System.Object, ByVal e As System.EventArgs) mean?
      I just don't get what the () after the sub name does...kind of stupid question, but it would be nice to understand it. Thanks. Kathy *** Sent...
    2. Why are sender and object used as in sender As System.Object, ByVal e As System.EventArgs?
      Why specifically are sender and object used? I could use dfs as Object and l as Evenat args. Some books show s instead of sender. Just wondering why...
    3. How to set default to TRUE: Overrides Function OnBubbleEvent(ByVal source As Object, ByVal args As EventArgs) As Boolean?
      Hello, how can I set the default value to TRUE of Overrides Function OnBubbleEvent(ByVal source As Object, ByVal args As EventArgs) As Boolean ?...
    4. passing value using eventargs
      is there a way to pass values using the eventargs of a certain event, lets say onclick?? or how does everyone else pass values? lets say each button...
    5. (Object source, EventArgs e)
      Hi, You know the parameters i'm talking about? void whatever (Object source, EvenArgs e)? how do you go about using those parameters? I need to...
  3. #2

    Default Re: what is EventArgs

    Hi,

    EventArgs is a base type for classes that contain event data. One should
    use this class to indicate that the current event isn’t containing any
    event data.

    by the way, what are trying to do ? Why do you create functions that
    receive events arguments ?

    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur Guest

  4. #3

    Default Re: what is EventArgs

    Hi

    When an Event is raised we need to which object [Control] is raised the
    event. It is specified by the sender and sometimes the Event raising object
    has to pass some values to the code which is handling event those values are
    passed in the EventArgs.

    eg. Assume We are moving the mouse in the form. The Event raised in
    MouseMove. In the MouseMove event handling code the sender is the Form and
    we also need to what is the X,Y position of the mouse which is obtained from
    MouseEventArgs argument.

    HTH
    Prasad

    "Yangtsi River" <nakhi@sina.com> wrote in message
    news:uGHjaTpRDHA.2460@TK2MSFTNGP10.phx.gbl...
    > Hi,
    > in any event procudure,there is two paras:sender As Object, e As
    EventArgs,
    > i copied them-not know what they are about, and my ASPX works.
    >
    > I guess the sender is the control by which I triggered this sub, and what
    is
    > EventArgs then?
    >
    > I am passing a third para to the sub, that is mysub("jim",sender As
    Object,
    > e As EventArgs),
    > the sub is defined like :
    > mysub(ByVal Nickname as string,sender As Object, e As EventArgs)
    > if nickname="jim" then
    > sdfsdfsd
    > end if
    > end sub
    > but when I call mysub("jim",sender As Object, e As EventArgs),, it said I
    > provided nothing about eventargs.
    > when I call mysub("jim"), it doesn't work too.
    >
    > THe sub is a event sub, triggered by a clicking a button.
    >
    > Can any one give me a hit ?
    >
    > Thanx
    > Yangtsi River
    >
    >
    >
    >

    Prasad Guest

  5. #4

    Default Re: what is EventArgs

    First of all, writing a server-side event handler to handle mouse movements
    is going to initialte a PostBack from the client every time the mouse moves
    one pixel in the browser. It's best to write client-side JavaScript event
    handlers for that sort of thing. As for server-side event handlers for
    controls that contain data in them, it's really a simple matter of writing a
    custom Server Control that inherits the base class and provides its own
    custom Event arguments class that inherits EventArgs and extends it with the
    properties you need to contain the data.

    --
    HTH,

    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    [url]http://www.takempis.com[/url]
    Big things are made up
    of lots of little things

    "Prasad" <prasadh_ms@hotmail.com> wrote in message
    news:OcoxjJqRDHA.2768@tk2msftngp13.phx.gbl...
    > Hi
    >
    > When an Event is raised we need to which object [Control] is raised
    the
    > event. It is specified by the sender and sometimes the Event raising
    object
    > has to pass some values to the code which is handling event those values
    are
    > passed in the EventArgs.
    >
    > eg. Assume We are moving the mouse in the form. The Event raised in
    > MouseMove. In the MouseMove event handling code the sender is the Form and
    > we also need to what is the X,Y position of the mouse which is obtained
    from
    > MouseEventArgs argument.
    >
    > HTH
    > Prasad
    >
    > "Yangtsi River" <nakhi@sina.com> wrote in message
    > news:uGHjaTpRDHA.2460@TK2MSFTNGP10.phx.gbl...
    > > Hi,
    > > in any event procudure,there is two paras:sender As Object, e As
    > EventArgs,
    > > i copied them-not know what they are about, and my ASPX works.
    > >
    > > I guess the sender is the control by which I triggered this sub, and
    what
    > is
    > > EventArgs then?
    > >
    > > I am passing a third para to the sub, that is mysub("jim",sender As
    > Object,
    > > e As EventArgs),
    > > the sub is defined like :
    > > mysub(ByVal Nickname as string,sender As Object, e As EventArgs)
    > > if nickname="jim" then
    > > sdfsdfsd
    > > end if
    > > end sub
    > > but when I call mysub("jim",sender As Object, e As EventArgs),, it said
    I
    > > provided nothing about eventargs.
    > > when I call mysub("jim"), it doesn't work too.
    > >
    > > THe sub is a event sub, triggered by a clicking a button.
    > >
    > > Can any one give me a hit ?
    > >
    > > Thanx
    > > Yangtsi River
    > >
    > >
    > >
    > >
    >
    >

    Kevin Spencer Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139