RE: Help with "onclick", "javascript:__doPostBack" syntax

Discussion in 'ASP .Net' started by William J. Familia, Feb 20, 2009.

  1. Maybe you already saw this one, but it appears to match your needs:
    http://www.codeproject.com/KB/webforms/dgrowselect.aspx

    The trick is to correctly create the UniqueID for each row and pass that in
    the __doPostBack.

    --
    William J. Familia


    "Arch Stanton" wrote:

    > I'd like to make the rows in my datagrid clickable, so that a button
    > control is clicked when my user clicks anywhere on the row. Google has
    > tons of links on this, but I'm having trouble understanding the material.
    >
    > Currently, I have my rows outlined on mouseover with this code:
    >
    > e.Item.Attributes.Add("onmouseover","this.style.outline = '1px solid
    > blue';")
    > e.Item.Attributes.Add("onmouseout","this.style.outline = '1px solid
    > white';")
    >
    > This works great, and it's straightforward (although I got help from the
    > group on this, too). From my attempts with Google, I think I need to use
    > another line of this form:
    >
    > e.Item.Attributes.Add("onclick", "javascript:__doPostBack".....
    >
    > javascript:__doPostBack takes two arguments, eventtarget and
    > eventargument, but I can't figure out how to use them. Can someone tell
    > me how these arguments are used to fire a link button, or any kind of
    > datagrid button control?
    >
    > Somebody asked this question two years ago in this group, and the only
    > reply he got was a snarky put-down, so sorry in advance for the retarded
    > question.
    >
    >
    >
    >
    > --
    > Posted Via Newsfeeds.com Premium Usenet Newsgroup Service
    > ----------------------------------------------------------
    > http://www.Newsfeeds.com
    >
    >
     
    William J. Familia, Feb 20, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nikhil Patel

    javascript:__doPostBack error

    Nikhil Patel, Feb 26, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    8,056
    Scott M.
    Feb 26, 2004
  2. bredal Jensen
    Replies:
    4
    Views:
    23,359
    bredal Jensen
    Apr 27, 2004
  3. Xarky
    Replies:
    6
    Views:
    822
    vMike
    Mar 31, 2005
  4. Steve Richter

    javascript:__doPostBack problems

    Steve Richter, Apr 27, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    716
    Steve Richter
    Apr 27, 2005
  5. Replies:
    0
    Views:
    546
Loading...

Share This Page