Home All Groups Group Topic Archive Search About

Detailsview with command field displayed as button

Author
11 Mar 2006 10:55 PM
mt
Hi

I'm using the detailsview web control with a command field (New, Insert,
Cancel). I added the following script to the "onclientclick" property when
the commandname is "Cancel" to prompt the user before canceling the insert
operation.

return confirm("are you sure?");

Everything works fine when I set the display style (button, image, link) of
the command field to "link". I get the pop-up dialog prompting "are you
sure?" when I click cancel. If I choose "OK" on the dialog, the cancel
operation is completed successfully.

It does not work the same way when I change the display style (button.
image, link) of the command field to "button". It displays the pop-up dialog
but nothing happens when I choose "OK" on the dialog. It is supposed to
complete the cancel operation.

Is this a bug? (It sure looks like bug when you view the generated HTML
source for cancel button)

Any help is appreciated.

Thanks

Author
13 Mar 2006 8:00 AM
Yuan Ren[MSFT]
Hi,

Thanks for posting!

For the current issue, if you think this is a bug issue, could you please
make a simple demo which can repro the problem and send it to me? I
understand this will takes your certain time to do. However, if I can
confirm this is a bug issue, I'll submit a bug to our dev team. This will
help me to give you some workaround or a hot fix for it. I appreciate your
understanding. My alias is v-y***@online.microsoft.com (remove .online).
I'm looking forward your reply!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
Author
13 Mar 2006 7:58 PM
mt
I emailed a sample page and steps to reproduce the problem.

Thanks

""Yuan Ren[MSFT]"" wrote:

Show quoteHide quote
> Hi,
>
> Thanks for posting!
>
> For the current issue, if you think this is a bug issue, could you please
> make a simple demo which can repro the problem and send it to me? I
> understand this will takes your certain time to do. However, if I can
> confirm this is a bug issue, I'll submit a bug to our dev team. This will
> help me to give you some workaround or a hot fix for it. I appreciate your
> understanding. My alias is v-y***@online.microsoft.com (remove .online).
> I'm looking forward your reply!
>
> Regards,
>
> Yuan Ren [MSFT]
> Microsoft Online Support
>
>
Author
15 Mar 2006 6:05 AM
Yuan Ren[MSFT]
Hi Mahesh,

Thanks for your reply!

I have performed the testing. Actually, the problem is caused by the
difference between the LinkButton and Button. Please replace the following
statement to yours:
link.OnClientClick = "if(!confirm('Do you really want to discard the
changes?')){return false;}";

Hope this will be helpful!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support