auto postback(urgent!)

Discussion in 'ASP .Net Datagrid Control' started by sunny, Jan 29, 2005.

  1. sunny

    sunny Guest

    Hi everybody,

    I have a datagrid and a button(id=Button1). when the user select the row. I
    want to excute javascript to invoke "__doPostBack("Button1","")" . just like
    the user press the button and do the postback. In reguar aspx, It works
    great. But in user control(ascx). because all control's id in the
    usercontrol will change (add a prefix for example "abc_Button1"). No matter
    I use "__doPostBack("Button1","")" or "__doPostBack("abc_Button1","")" I
    can't catch the event( button.click). How can I fix this problem, anyone has
    a idea?

    Thanks a lot!

    Sunny.
     
    sunny, Jan 29, 2005
    #1
    1. Advertisements

  2. sunny

    Sonu Kapoor Guest

    Try to add the onclick event to the button dynamically.
    That way you can find the clientID of the button and pass
    it as a parameter to your function.

    Good Luck!
    Sonu Kapoor
    http://kapoorsolutions.com/blog


    >-----Original Message-----
    >Hi everybody,
    >
    >I have a datagrid and a button(id=Button1). when the

    user select the row. I
    >want to excute javascript to invoke "__doPostBack

    ("Button1","")" . just like
    >the user press the button and do the postback. In reguar

    aspx, It works
    >great. But in user control(ascx). because all control's

    id in the
    >usercontrol will change (add a prefix for

    example "abc_Button1"). No matter
    >I use "__doPostBack("Button1","")" or "__doPostBack

    ("abc_Button1","")" I
    >can't catch the event( button.click). How can I fix this

    problem, anyone has
    >a idea?
    >
    >Thanks a lot!
    >
    >Sunny.
    >
    >
    >
     
    Sonu Kapoor, Jan 30, 2005
    #2
    1. Advertisements

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

    Auto Postback Issue

    yoyo, Aug 26, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    2,213
  2. Thomas Due
    Replies:
    0
    Views:
    624
    Thomas Due
    Apr 20, 2004
  3. Psych971
    Replies:
    5
    Views:
    4,909
    bruce barker
    Dec 17, 2004
  4. nicholas
    Replies:
    4
    Views:
    639
    Karl Seguin
    Mar 14, 2005
  5. Elhanan
    Replies:
    4
    Views:
    2,333
    Elhanan
    Dec 24, 2005
  6. =?Utf-8?B?V2FyYW4=?=

    Auto-Suggested Textbox like google auto suggest

    =?Utf-8?B?V2FyYW4=?=, Apr 20, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    8,774
    inrakeshworld
    Jul 27, 2007
  7. Anders
    Replies:
    0
    Views:
    976
    Anders
    Apr 27, 2006
  8. Silvia Brunet Jones

    Dropdownlist auto drop onfocus URGENT

    Silvia Brunet Jones, Sep 30, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    269
    Silvia Brunet Jones
    Sep 30, 2003
Loading...