Hi ramco1917,
Yes, you can.
Refer below example.
HTML
<asp:Button ID="btnDraft" runat="server" OnClick="btnSubmit_Click" class="btn bg-blue" Text="Save as Draft" />
<asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" class="btn bg-blue" Text="Save" />
Code
C#
protected void btnSubmit_Click(object sender, EventArgs e)
{
string buttonText = (sender as Button).Text;
switch (buttonText.ToUpper())
{
case "SAVE AS DRAFT":
// Do the task.
break;
case "SAVE":
// Do the task.
break;
default:
break;
}
}
VB.Net
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim buttonText As String = TryCast(sender, Button).Text
Select Case buttonText.ToUpper()
Case "SAVE AS DRAFT"
' Do the task.
Case "SAVE"
' Do the task.
Case Else
End Select
End Sub