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. DropDownList

DropDownList

Scheduled Pinned Locked Moved ASP.NET
help
2 Posts 2 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.
  • W Offline
    W Offline
    waheed awan
    wrote on last edited by
    #1

    in my .cs file when i write droplist.Attributes.Add("onclick", "return confirm('Do you wAnt to continue')"); the above is working but when i write droplist.Attributes.Add("onclick", "click()"); it doesnot what shud i do to solve the problem i have a function in cs file public void click() { }

    P 1 Reply Last reply
    0
    • W waheed awan

      in my .cs file when i write droplist.Attributes.Add("onclick", "return confirm('Do you wAnt to continue')"); the above is working but when i write droplist.Attributes.Add("onclick", "click()"); it doesnot what shud i do to solve the problem i have a function in cs file public void click() { }

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      droplist.Attributes.Add("onclick", "click()"); This line of code establishes that a javascript function named 'click()' will handle the javascript onclick event for your dropdownlist control. i have a function in cs file public void click() { } You are confusing client-side event handlers (typically written in Javascript, located in the ASPX page) with server-side event handlers (written in your preferred .NET language, located in the code-behind file). There's no server-side onclick event for the DropDownList control, so presumably you want to define a javascript method to execute in the client's browser. You can do this thus: function click() { // add implementation here } Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

      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