Page_Load i need to see which event fired the post back

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?=

    Page_Load i need to see which event fired the post back

    In the page_load event i need to see which event fired the post back. what
    here allows this. I specificly want to know if the enter key was pressed. but
    i need to check for others.
    --
    (i''ll be asking a lot of these, but I find C# totally way cooler than vb
    and there''s no go''n back!!!)
    thanks (as always)

    kes
  • Mark Rae [MVP]

    #2
    Re: Page_Load i need to see which event fired the post back

    "WebBuilder 451" <WebBuilder451@ discussions.mic rosoft.comwrote in message
    news:E3BAF684-FC44-49B0-9036-08BA8177E206@mi crosoft.com...
    In the page_load event i need to see which event fired the post back. what
    here allows this. I specificly want to know if the enter key was pressed.
    but
    i need to check for others.
    Generally speaking, this isn't the way ASP.NET works. E.g. when you click a
    Button control, it initiates a postback and its Click or Command event
    runs - you don't need to know in the Page_Load which object initiated the
    postback... You don't need to know which control initiated the postback
    because, whatever control it was, that's the event which will fire.

    However, it's fairly simple to find out this information:


    Why do you need to know this in Page_Load...?


    --
    Mark Rae
    ASP.NET MVP


    Comment

    • =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?=

      #3
      Re: Page_Load i need to see which event fired the post back

      in Safari the default event for the panel does not fire. so on a login it
      works when you press enter for ie, firefox, but not safari.

      i'm using the text changed event on the password field, but this is still a
      poor solution.

      In my case i need to know if events were not fired so i can call login.
      --
      (i''ll be asking a lot of these, but I find C# totally way cooler than vb
      and there''s no go''n back!!!)
      thanks (as always)

      kes


      "Mark Rae [MVP]" wrote:
      "WebBuilder 451" <WebBuilder451@ discussions.mic rosoft.comwrote in message
      news:E3BAF684-FC44-49B0-9036-08BA8177E206@mi crosoft.com...
      >
      In the page_load event i need to see which event fired the post back. what
      here allows this. I specificly want to know if the enter key was pressed.
      but
      i need to check for others.
      >
      Generally speaking, this isn't the way ASP.NET works. E.g. when you click a
      Button control, it initiates a postback and its Click or Command event
      runs - you don't need to know in the Page_Load which object initiated the
      postback... You don't need to know which control initiated the postback
      because, whatever control it was, that's the event which will fire.
      >
      However, it's fairly simple to find out this information:

      >
      Why do you need to know this in Page_Load...?
      >
      >
      --
      Mark Rae
      ASP.NET MVP

      >
      >

      Comment

      • Mark Rae [MVP]

        #4
        Re: Page_Load i need to see which event fired the post back

        "WebBuilder 451" <WebBuilder451@ discussions.mic rosoft.comwrote in message
        news:2D06E6F4-5CF0-4475-86B4-E0BFAA197754@mi crosoft.com...

        [top-posting corrected]
        >>In the page_load event i need to see which event fired the post back.
        >>what
        >>here allows this. I specificly want to know if the enter key was
        >>pressed.
        >>but I need to check for others.
        >>
        >Why do you need to know this in Page_Load...?
        >
        In Safari the default event for the panel does not fire. so on a login it
        works when you press enter for IE, FireFox, but not Safari.
        Ah - that's a totally different question. Loads of stuff about Safari and
        the Enter key on the net:




        --
        Mark Rae
        ASP.NET MVP


        Comment

        Working...