Answers for "asp.net button onclick"

C#
0

asp.net button onclick

<script runat="server">

    void Btn_Click(Object sender, EventArgs e)
    {
        // When the button is clicked,
        // change the button text, and disable it.
        Button clickedButton = (Button)sender;
        clickedButton.Text = "...button clicked...";
        clickedButton.Enabled = false;        
        // Display the greeting label text.
        GreetingLabel.Visible = true;
    }
</script>

<html>
...
  <asp:Button id="Button1"
    Text="Click here for greeting..."
    OnClick="Btn_Click" 
    runat="server"/>
...
</html>
Posted by: Guest on June-16-2021

C# Answers by Framework

Browse Popular Code Answers by Language