radconfirm closes immediately after popup

6 posts, 0 answers
  1. chp
    chp avatar
    11 posts
    Member since:
    Oct 2012

    Posted 06 Mar 2009 Link to this post

    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?
  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 06 Mar 2009 Link to this post

    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.
  3. Sajeev
    Sajeev avatar
    4 posts
    Member since:
    Oct 2008

    Posted 15 Apr 2009 Link to this post

    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
  4. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 15 Apr 2009 Link to this post

    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.
  5. Hans Gunnar
    Hans Gunnar avatar
    13 posts
    Member since:
    Jan 2009

    Posted 17 Mar 2010 Link to this post

    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?
  6. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 19 Mar 2010 Link to this post

    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.
Back to Top