After click on "Save" button only "Update" Button will show. How I do it on form?

1 Answer 591 Views
Ajax
Tanvir
Top achievements
Rank 1
Iron
Tanvir asked on 15 Dec 2022, 06:26 AM | edited on 15 Dec 2022, 06:27 AM

After clicking on the "Save" button only the "Update" Button will show. How do I do it on the form? 

<tr>
                <td>
                    <div runat="server" id="PrimaryBtnWrapper" class="btn-wrapper">
                    <telerik:RadButton RenderMode="Lightweight" ID="btnSave" runat="server" Skin="Silk" OnClick="btnSave_Click" Primary="true" 
                        Text=" Save " GroupName="GroupName1">
                    </telerik:RadButton>
                </div>
                </td>

                <td>
                    <div runat="server" id="PrimaryBtnWrapper1" class="btn-wrapper">
                    <telerik:RadButton RenderMode="Lightweight" ID="btnUpdate" runat="server" Skin="Office2007" OnClick="btnUpdate_Click" Primary="true" 
                        Text=" UPDATE " GroupName="GroupName1">
                    </telerik:RadButton>
                </div>
                </td>
            </tr>

 

Tanvir
Top achievements
Rank 1
Iron
commented on 19 Dec 2022, 05:29 AM

From the .cs file, I create a method that checks if all the condition is true and then shows the 'save' button. if all the condition is false then show the 'update' button. And I call it Post back method.

protected void ButtonCheck()
    {
        if (txtAddress.Text != "" && txtEdu.Text != "" && txtContact.Text != "" && txtemail.Text != "")
        {
            btnSave.Style["display"] = "none";
        } 
        else if (txtAddress.Text == "" && txtEdu.Text == "" && txtContact.Text == "" && txtemail.Text == "")
        {
            btnUpdate.Style["display"] = "none";
        }
}

 

1 Answer, 1 is accepted

Sort by
-1
Accepted
Valentin Dragnev
Telerik team
answered on 19 Dec 2022, 03:25 PM

Hello Tanvir,

Affirmative, your solution is valid and looks OK.

Best regards,
Valentin Dragnev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Ajax
Asked by
Tanvir
Top achievements
Rank 1
Iron
Answers by
Valentin Dragnev
Telerik team
Share this question
or