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. OnClientClick in girdView ??

OnClientClick in girdView ??

Scheduled Pinned Locked Moved ASP.NET
questionhelp
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.
  • A Offline
    A Offline
    Amr M K
    wrote on last edited by
    #1

    OnClientClick='<%# Eval("cID" , "window.open("open.aspx?cID={0}");" ) %>' give error how can I write it correctly? aj123

    J D 2 Replies Last reply
    0
    • A Amr M K

      OnClientClick='<%# Eval("cID" , "window.open("open.aspx?cID={0}");" ) %>' give error how can I write it correctly? aj123

      J Offline
      J Offline
      Jay_se
      wrote on last edited by
      #2

      Tkp1452 wrote:

      '<%# Eval("cID" , "window.open("open.aspx?cID={0}");" ) %>'

      Try like this. I am not sure, whether it works or not. '<%# "window.open('open.aspx?cID="+ Eval("cID")+"')" %>' But I have used like this, (for Anchor tag) href='<%# "ToolDescription.aspx?ToolId=" + Eval("ToolID") %>' Please let me know your feedback

      Regards, Jay :)

      1 Reply Last reply
      0
      • A Amr M K

        OnClientClick='<%# Eval("cID" , "window.open("open.aspx?cID={0}");" ) %>' give error how can I write it correctly? aj123

        D Offline
        D Offline
        dekart_roo
        wrote on last edited by
        #3

        I'm pretty sure the error is coming from the <%# %> tags. At the point of OnClientClick, everything is being directly translated into JavaScript, and Javascript does not support those tags. If you need to combine asp.net variables with javascript, I'd recommend using the click attribute, and setting up a server side event handler. Either that, or you could always "cheat" it, by having a hidden data field that you write to via asp.net, and read from via javascript to execute your Eval(). -Roo

        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