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

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

    Auto Postback Issue

    yoyo, Aug 26, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    2,049
  2. Psych971
    Replies:
    5
    Views:
    4,605
    bruce barker
    Dec 17, 2004
  3. =?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,510
    inrakeshworld
    Jul 27, 2007
  4. linkswanted
    Replies:
    1
    Views:
    896
  5. Silvia Brunet Jones

    Dropdownlist auto drop onfocus URGENT

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

Share This Page