Lab 3 Scheme
Lab 3 Scheme
i. Replace the highlighted web controls (in red-dashed box) with another suitable web controls.
ii. Add another button, name ‘Check’ to check whether both TextBoxes for ‘Create a password’
and ‘Confirm your password’ are entered with same input. Refer Figure 3 and 4 for example of
the output. You may use provided image in KALAM as your Button (OK.png and NOT.png)
Later, by using postback approach, write a C# code to display all the entered input by the user. For CSS,
please refer to Table 1. Example of the output is as shown in Figure 2.
Table 1: CSS
Item Feature
Background image background.png
Font family Papyrus
Border style Ridge
1
Display LastName here
Figure 3: If Both ‘Create a password’ and ‘Confirm your password’ are equal, when Check button is
clicked, the above image will appear.
Figure 4: If Both ‘Create a password’ and ‘Confirm your password’ are not equal, when Check button is
clicked, the above image will appear.
2
Answer:
3
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
LblGreet.Text = "Hi "+ TBLastName.Text + ". The followings are your details.";
LblName.Text = "Name :";
LblName0.Text = TBFirstName.Text + " " + TBLastName.Text;
}
protected void Button1_Click(object sender, EventArgs e)
{
if (TBPassword.Text != TBPassword0.Text)
{
Image1.ImageUrl = "NOT.png";
}
else
{
Image1.ImageUrl = "OK.png";
}
Q2. Create a webpage for Used Books Online Store which will calculate the total amount that has to be
paid by the customer. When the item is selected, the price of the item will be displayed next to the
DropDownList (enable AutoPostBack of the DropDownList). Later, create a function to calculate the total
price (without 6% GST) and grand total of the price (inclusive of 6% GST) for the selected items (see Table
1). The price of the selected items are collected using DropDownList (see Figure 5 for example). Example
of the output is as shown in Figure 6.
4
Sherlock Holmes 90
Science and Fantasy Living Forever 100
Galaxy Jane 80
Planet of Exile 90
Item
Price
Figure 5: DropDownList
5
The price of the selected item will be
displayed here whenever the item in the
DropDownList is selected.
return 0;
}
6
protected void Page_Load(object sender, EventArgs e)
{
if (DropDownList1.Text == "0")
{
LblPrice1.Text = "Please select an item";
}
else
{
LblPrice1.Text = DropDownList1.SelectedValue;
}
if (DropDownList2.Text == "0")
{
LblPrice2.Text = "Please select an item";
}
else
{
LblPrice2.Text = DropDownList2.SelectedValue;
}
if (DropDownList3.Text == "0")
{
LblPrice3.Text = "Please select an item";
}
else
{
LblPrice3.Text = DropDownList3.SelectedValue;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Calculate();
}
}