Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Triggering a server-side event from a client-side

Triggering a server-side event from a client-side

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptsysadminquestionannouncement
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dan sh
    wrote on last edited by
    #1

    Short version All I need is that, in a ModalPopUp, when the DoubleClick event of a ListItem fires, the click event of my OK button should be executed. Detail I have a ModalPopUpExtender, which hosts a user control. The user control has an OK and a Cancel button. Along with that, it has a dynamic ListBox added to it(may be more). So far, I've considered the following possible solutions: 1. Use Ajax.Net. But, I cannot afford to have a WebMethod. 2. Use a ClientScriptCallBack. This will need a lot of JavaScript, since I have made almost every control dynamic. Is there any other way apart from using an UpdatePanel?

    जय हिंद

    C 1 Reply Last reply
    0
    • D dan sh

      Short version All I need is that, in a ModalPopUp, when the DoubleClick event of a ListItem fires, the click event of my OK button should be executed. Detail I have a ModalPopUpExtender, which hosts a user control. The user control has an OK and a Cancel button. Along with that, it has a dynamic ListBox added to it(may be more). So far, I've considered the following possible solutions: 1. Use Ajax.Net. But, I cannot afford to have a WebMethod. 2. Use a ClientScriptCallBack. This will need a lot of JavaScript, since I have made almost every control dynamic. Is there any other way apart from using an UpdatePanel?

      जय हिंद

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      That's easy. Assuming there is a double click event at all ( and if not, you could fake one ), you just hook that up to javascript, which calls the script to fire the OK button.

      Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

      L D 2 Replies Last reply
      0
      • C Christian Graus

        That's easy. Assuming there is a double click event at all ( and if not, you could fake one ), you just hook that up to javascript, which calls the script to fire the OK button.

        Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

        L Offline
        L Offline
        Leonscape
        wrote on last edited by
        #3

        How I wish it was that easy, unfortunately some browsers disable that ability and even then for some reason it doesn't always work. You can however you Page.ClientScript.GetPostBackEventReference(Control, String) to do this.

        Using the wrong tool for the job is half the fun.

        1 Reply Last reply
        0
        • C Christian Graus

          That's easy. Assuming there is a double click event at all ( and if not, you could fake one ), you just hook that up to javascript, which calls the script to fire the OK button.

          Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

          D Offline
          D Offline
          dan sh
          wrote on last edited by
          #4

          Christian Graus wrote:

          Assuming there is a double click event at all ( and if not, you could fake one )

          Done that and its working fine.

          Christian Graus wrote:

          you just hook that up to javascript, which calls the script to fire the OK button.

          Are you referring to PageMethods.MethodName()? I don't want to use it since it will make the event a WebMethod.

          जय हिंद

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups