I have loaded a new page in Web application (webform) using c#. I added a text box and a button to the Design. I double clicked the Button and in the aspx.cs page I added the following:
protected void Button1_Click(object sender, EventArgs e)
{
string name = "Tom";
MessageBox.Show("My name is " + name);
}
This, as far as I know, should add text "My name is Tom" inside the Button. But I do not see this reflected in the design (Button is all that is displayed in the button) nor in the html (which makes sense if the new text is not seen in the design).
<body>
<form id="form1" runat="server">
<div>
</div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</form>
Why is the .cs file not reflected in the html file?
Thank You Tom