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

    example "abc_Button1"). No matter
     
    Sonu Kapoor, Jan 30, 2005
    #2
    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.