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. asp equivilent for "onclick"

asp equivilent for "onclick"

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-netquestion
3 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.
  • K Offline
    K Offline
    krisman
    wrote on last edited by
    #1

    Hi. Is there an ASP.NET equivilent of javascript "onclick"? Krisman

    P 1 Reply Last reply
    0
    • K krisman

      Hi. Is there an ASP.NET equivilent of javascript "onclick"? Krisman

      P Offline
      P Offline
      Paul Watson
      wrote on last edited by
      #2

      Yes, onclick in fact. It overrides the JavaScript one when used on a server control. So onclick of this button <asp:Button onclick="myServersideEvent" runat="server" /> a server side (ASP.NET) event will be fired with a postback, it won't look for a JavaScript event handler on the client side. On the server side you would have:protected void myServersideEvent(object sender, eventArgs e){...}. regards, Paul Watson Bluegrass South Africa Brian Welsch wrote: "blah blah blah, maybe a potato?" while translating my Afrikaans. Crikey! ain't life grand?

      S 1 Reply Last reply
      0
      • P Paul Watson

        Yes, onclick in fact. It overrides the JavaScript one when used on a server control. So onclick of this button <asp:Button onclick="myServersideEvent" runat="server" /> a server side (ASP.NET) event will be fired with a postback, it won't look for a JavaScript event handler on the client side. On the server side you would have:protected void myServersideEvent(object sender, eventArgs e){...}. regards, Paul Watson Bluegrass South Africa Brian Welsch wrote: "blah blah blah, maybe a potato?" while translating my Afrikaans. Crikey! ain't life grand?

        S Offline
        S Offline
        Sarvesvara BVKS Dasa
        wrote on last edited by
        #3

        hi... as a continuation, can u pls put down a code that opens a seperate wondow and executes a aspx page there. I want the 'onclick' function, and want to know where/how to place the same. I was born intelligent
        Education ruined me!.

        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