This is a migrated thread and some comments may be shown as answers.

radconfirm closes immediately after popup

5 Answers 195 Views
Window
This is a migrated thread and some comments may be shown as answers.
chp
Top achievements
Rank 1
chp asked on 06 Mar 2009, 09:49 AM
hi,
i got following problem:  if i click on linkbutton the radconfirm popups, but it closes immediatly and then the server code will be executed without confirmation.

<asp:LinkButton ID="btnDelete" Visible="false" runat="server" CausesValidation="False" 
                    CssClass="DeleteButton" OnClick="btnDelete_Click" OnClientClick="return radconfirm('Möchten Sie wirklich löschen')" 
                    Text="Löschen"></asp:LinkButton> 

Any idea, why it closes immediatly?

5 Answers, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 06 Mar 2009, 01:08 PM
Hi Chp,

This behavior is the expected one, because when you click on the LinkButton a postback is triggered and the page is refreshed.
You can avoid the postback by using the following code :

<asp:LinkButton ID="btnDelete" Visible="false" runat="server" CausesValidation="False" 
    CssClass="DeleteButton" OnClick="btnDelete_Click" OnClientClick="radconfirm('Möchten Sie wirklich löschen'); return false;" 
    Text="Löschen"
</asp:LinkButton> 


Sincerely yours,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Sajeev
Top achievements
Rank 2
answered on 15 Apr 2009, 05:36 AM
Hi Fiko,

With your code, the confirm stays for the user input, but will not trigger the link button event if OK is clicked.

regards,
Sajeev
0
Fiko
Telerik team
answered on 15 Apr 2009, 01:50 PM
Hi Sajeev,

This behavior is expected and it is caused by the "return false" statement that cancels the event.
However, you could use this approach in order to achieve the desired behavior. For your convenience I have reworked the ASP.NET2.0 example in order to use the ASP.NET AJAX version of the controls. Could you please check it and let me know whether it fits your requirement?


Kind regards,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Hans Gunnar
Top achievements
Rank 1
answered on 17 Mar 2010, 09:03 AM
Hi, following the example code above, and also when trying the similar code here: http://demos.telerik.com/aspnet-ajax/window/examples/browserdialogboxes/defaultcs.aspx ("Confirm postback with radconfirm") I encounter a major problem.

After the confirm-window pops up, pressing "Cancel" works fine. The popup disappears and no postback is done.

But if I press "OK" nothing happens. The confirm-window either stays there or reopens quickly (might be I see a flicker). I'm using Internet Explorer 7.

Has there perhaps been any updates to this control lately making the example-code invalid? Or is it some other error?
0
Georgi Tunev
Telerik team
answered on 19 Mar 2010, 03:03 PM
Hello Hans,

I tried to reproduce the problem on our live demo but everything worked as expected - we haven't made any changes in this logic and you are the first to report such issue. Could you please try resetting your browser's settings and try again?


Kind regards,
Georgi Tunev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Window
Asked by
chp
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Sajeev
Top achievements
Rank 2
Hans Gunnar
Top achievements
Rank 1
Georgi Tunev
Telerik team
Share this question
or