-
Notifications
You must be signed in to change notification settings - Fork 0
/
Homepage.aspx.cs
54 lines (46 loc) · 1.69 KB
/
Homepage.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace TinyTotsWebApp
{
public partial class Homepage : System.Web.UI.Page
{
// Define a Boolean variable to represent gender
private bool isBoy;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// Run this code only on the initial page load
var img = Resource1.Logo_Tadika_Arep;
}
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
// Handle the dropdown selection change event (if needed)
}
protected void RadioButton_CheckedChanged(object sender, EventArgs e)
{
// Handle the RadioButton selection event
RadioButton selectedRadioButton = (RadioButton)sender;
if (selectedRadioButton.ID == "RadioButton1")
{
// "Boy" is selected
isBoy = true;
}
else if (selectedRadioButton.ID == "RadioButton2")
{
// "Girl" is selected
isBoy = false;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
string firstName = TextBox1.Text; // Get the value from the first name TextBox
// Generate a message based on the gender Boolean value
string genderMessage = isBoy ? "Boy" : "Girl";
// Update the "SubmitLabel" control with a greeting message
SubmitLabel.Text = "Thank you " + firstName + "! You have submitted the registration form on " + DateTime.Now.ToString();
}
}
}