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( How can I fix this problem, anyone has
    a idea?

    Thanks a lot!

    sunny, Jan 29, 2005
    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

    example "abc_Button1"). No matter
    Sonu Kapoor, Jan 30, 2005
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.