.NET Browser events

Discussion in 'Programming' started by daeko, Sep 21, 2010.

  1. #1
    Hello,

    Is there a way to catch browser events (such as a click go back button for ex) in asp.net?

    Thanks for your help.
     
    daeko, Sep 21, 2010 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    .Net is only on the server side and what you are talking about is client side events. If you can trigger a javascript event by the activity then you can use javascript to make a callback to the server and this can then be processed by .Net
     
    AstarothSolutions, Sep 21, 2010 IP
  3. daeko

    daeko Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for feeback, I'll try to get more details on how to catch those events with javascript.
     
    daeko, Sep 21, 2010 IP
  4. daeko

    daeko Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Finally wrote some javascript functions to catch those. Seems to work fine for now.
     
    daeko, Sep 24, 2010 IP
  5. longcall911

    longcall911 Peon

    Messages:
    1,672
    Likes Received:
    87
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yes of course. All asp controls have associated event behaviors. It's kind of the whole reason for asp.

    Onload, onclick, onhover, onmousedown, up, onpostback, and pretty much everything you can possible do with a control is available. And exceptions are easily handled with a try/catch block (c#).
     
    longcall911, Sep 24, 2010 IP
  6. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #6
    Of course you don't need asp at all and can do just as much and more with plain javascript.
     
    drhowarddrfine, Sep 24, 2010 IP