Calling a function in codebehind from the html side of the aspx?

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

  1. #1

    Default Calling a function in codebehind from the html side of the aspx?

    I read from some book that you can actually on any tag in the html page put
    a onClick or something and assign it with the sub/function name that is in
    the codebehind. I tried but it say name undefined.

    I am trying to make a rollover effect using codebehind. I have a <a> tag
    that onmouseover will call a sub in codebehind to change a <asp:image> image
    url.

    How come i can see a lot of "on" events of the <a> in the html side but when
    i declare it in the codebehind and i can only access only a few of them?

    thanks.


    exshige Guest

  2. Similar Questions and Discussions

    1. Calling an Ascx from w/i Aspx codebehind
      I have an aspx that I would like to "dynamically" display a user control on. When the user clicks (LinkButton) on "Find Existing Trip" within the...
    2. Reach UserControl from ASPX codebehind?
      Hi, I created a usercontrol and dropped it onto my aspx... But from CodeBehind of that aspx I can't reach to that UserControl...I just want to...
    3. Help! Having trouble calling codebehind function from repeater results!
      Hi, I have a data repeater that is returning a list of events. One of the things I want to do is give the user a way to edit or delete an event....
    4. Controls with a client side onLoad function or seting a cursor server side
      Is there any way to create a web control that calls a client side onLoad function? Its diffucilt since you are not able to access the form or...
    5. textbox value not getting to the asp.vb codebehind code from the html layer.
      Hi, do you set the textbox to default value in page_load. if so use Page.IspPostback to disable this setting on postback. Natty Gur, CTO...
  3. #2

    Default Re: Calling a function in codebehind from the html side of the aspx?

    It seems you misinterpreted the book that you read.

    You don't want the page to post back every time the mouse moves over an
    image. The performance would be terrible.

    You want to call client side code such as javascript to do this, not your
    code behind. And yes, you would use the (client side) onMouseOver event to
    call your javascript function.

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]


    "exshige" <exshige@yahoo.no.spam.com> wrote in message
    news:3f0a3df7$1_1@news.tm.net.my...
    > I read from some book that you can actually on any tag in the html page
    put
    > a onClick or something and assign it with the sub/function name that is in
    > the codebehind. I tried but it say name undefined.
    >
    > I am trying to make a rollover effect using codebehind. I have a <a> tag
    > that onmouseover will call a sub in codebehind to change a <asp:image>
    image
    > url.
    >
    > How come i can see a lot of "on" events of the <a> in the html side but
    when
    > i declare it in the codebehind and i can only access only a few of them?
    >
    > thanks.
    >
    >

    Steve C. Orr, MCSD Guest

  4. #3

    Default Re: Calling a function in codebehind from the html side of the aspx?

    hmm.. thanks.. i actually did thought of using js to do that like the old
    days.. but again, i thought maybe i could create something that is totally
    vb based... i tried to put the code from codebehind together with the html
    page under the script tag but it won't let me reference to other controls on
    the page inside that sub or function.

    i get what u mean.. well, i guess i have no choice but to use js.

    thanks.


    "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
    news:#XsllARRDHA.2676@TK2MSFTNGP10.phx.gbl...
    > It seems you misinterpreted the book that you read.
    >
    > You don't want the page to post back every time the mouse moves over an
    > image. The performance would be terrible.
    >
    > You want to call client side code such as javascript to do this, not your
    > code behind. And yes, you would use the (client side) onMouseOver event
    to
    > call your javascript function.
    >
    > --
    > I hope this helps,
    > Steve C. Orr, MCSD
    > [url]http://Steve.Orr.net[/url]
    >
    >
    > "exshige" <exshige@yahoo.no.spam.com> wrote in message
    > news:3f0a3df7$1_1@news.tm.net.my...
    > > I read from some book that you can actually on any tag in the html page
    > put
    > > a onClick or something and assign it with the sub/function name that is
    in
    > > the codebehind. I tried but it say name undefined.
    > >
    > > I am trying to make a rollover effect using codebehind. I have a <a> tag
    > > that onmouseover will call a sub in codebehind to change a <asp:image>
    > image
    > > url.
    > >
    > > How come i can see a lot of "on" events of the <a> in the html side but
    > when
    > > i declare it in the codebehind and i can only access only a few of
    them?
    > >
    > > thanks.
    > >
    > >
    >
    >

    exshige 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