Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2070
Can't use AjaxControlToolkit ConfirmButtonExtender with Image Button?
posted

Is there a reason why the AjaxControlToolkit ConfirmButtonExtender can't be used with an image button in a Web Data Grid with multi-pages? It works fine on the first page; but if I go to any other page and try the button, I immediate get a:

Microsoft JScript runtime error: Sys.InvalidOperationException: Two components with the same id 'ctl00_cphMainPageBody_wdgMedia_it0_0_ibDelete_ConfirmButtonExtender' can't be added to the application.

I have ClientIDMode="AutoID" specified on the ConfirmButtonExtender but that doesn't seem to do anything.

I know I can use Javascript on the OnCLientClick event to do the same thing, but why when the extender should work just as well?

-Tom

 

  • 33839
    Suggested Answer
    posted

    Hi Tom,

    I am going to guess you have EnableAjax set to true?  The most likely culprit is that the extender is not being unregistered when the grid is disposed of.  So a second extender with the same name gets registered.  You could try setting the id mode to static and hanle initialize row to set the id of the extender in each row to be something unique (taking paging into account, like row index plus paging offset).  Or try with ajax off so the whole page is rerendered.

    regards,
    David Young