We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

I need to confirm on one SplitItem

Thread ID:

Created:

Updated:

Platform:

Replies:

129939 Apr 11,2017 03:09 AM Apr 19,2017 07:40 AM ASP.NET Web Forms 5
loading
Tags: SplitButton
Carsten Wuttke
Asked On April 11, 2017 03:09 AM

Hello,

i have a dialog, that is filled by an AJAX-ASPX-Webforms-page. Working great so far. Now on this page is a SplitButtom with different SplitItems. One of those shall show a confirm-dialog like "You really want to delete?" and if the user clicks "yes" it shall call a generic handler not to change page. Can someone please help?

Francis Paul Antony Raj [Syncfusion]
Replied On April 12, 2017 12:44 PM

Hi Carsten, 
 
Thanks for contacting Syncfusion Support. 
 
We have analyzed your query. We understand that you are performing AJAX post on SplitButton Item Click event handler and you would like to prevent the AJAX Post with confirmation message when user click one specific item. We have prepared a simple sample to show case this scenario - Sample 
 
Please refer the below code example: 
 
[aspx] 
<ej:SplitButton ID="SplitButton" runat="server" Size="Large" ShowRoundedCorner="true" Text="Save" ClientSideOnItemSelected="onItemClick"> 
            <Items> 
                <ej:SplitItem Text="Open"></ej:SplitItem> 
                <ej:SplitItem Text="Save"></ej:SplitItem> 
                <ej:SplitItem Text="Delete"></ej:SplitItem> 
            </Items> 
</ej:SplitButton> 
 
[script] 
        function onItemClick(args) { 
 
            if ((args.text == "Delete" && !confirm('You really want to delete?')) || args.text != "Delete") {//prompt the USER  
 
                    $.ajax({ 
                        contentType: "application/json; charset=utf-8", 
                        type: "POST", 
                        url: "ButtonFeatures.aspx/Page1", 
                        dataType: "json", 
                        data: {}, 
                        success: function (xhr) { 
                            alert(xhr.d) // Ajax success  
                        }, 
                        error: function (xhr) { 
                            alert("Error"); // error alert if something went wrong  
                        } 
                    }); 
                } 
            // ajax post not occurs when Delete prompt is confirmed 
        } 
 
[aspx.cs] 
 
        [System.Web.Services.WebMethod] 
        public static string page1() 
        { 
            return "Hello " + Environment.NewLine + "The Current Time is: " 
                + DateTime.Now.ToString(); 
        } 
 
Please get back to us, if you need further assistance. 
 
Regards, 
Francis Paul A. 


Carsten Wuttke
Replied On April 13, 2017 10:49 AM

Hello Francis,
thx for the reply. I forgot to mention, that I create the Button and its items by code behind. And already found the solution. This here is working:
                              splitItem.Text = "Delete";
                            splitItem.Url = "javascript: deleteit('" + se.EncryptData(Data) + "')";
                            splitItem.SpriteCssClass = "remove";

BTW: How can I create such a neat box with Syntax-Highlighting in the Forum? ;-)

Francis Paul Antony Raj [Syncfusion]
Replied On April 17, 2017 02:19 AM

Hi Carsen, 
 
Thanks for the update. We glad to know that you have achieved your requirement in Code-Behind. 
 
Query: How can I create such a neat box with Syntax-Highlighting in the Forum? 
 
To create a code block with Syntax-Highlighting, please copy the code block from Visual Studio and paste it in the forum and to create a box, use the table option available in the RTE Toolbar under Message section of the Forum. 
 
Regards, 
Francis Paul A. 


Carsten Wuttke
Replied On April 18, 2017 06:39 AM

Hello Franis ;-),

thx for the info. Thought there were an option without the overhead of Microsofts C&P. But thx anyway.
Greets,
Carsten

sureshkumar.P [Syncfusion]
Replied On April 19, 2017 07:40 AM

Hi Carsten, 
We have an option to achieve your requirement (How can I create such a neat box with Syntax-Highlighting in the Forum) in our RTE tollbar with custom tool option. 
For your convenience, we have created the RTE sample with custom tool option. Here clicks the insert code button and then add your code block. 
 Please refer the jsplayground link: http://jsplayground.syncfusion.com/vecpbmpa.  
To know more about custom tool option in RTE please refer the below documentation link:  
Regards, 
Sureshkumar P 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;