Question: I am looking for the code in visual basic to calculate the radio button that is selected x the number of nights selected (this can
I am looking for the code in visual basic to calculate the radio button that is selected x the number of nights selected (this can be 1 - 10 nights) sent to the web form called [lblReservation}
A reservation has been made for Name
The total cost to stay at (selected city's name if possible) is $XX.XX
Arrival Date is x/x/x for x Night(s).
Below is my current code:
Partial Class _Default Inherits Page
Protected Sub btnSubmit_Click(sender As Object, e As EventArgs) Handles btnSubmit.Click
Dim strName As String 'Dim intNumberofNights As Integer
' Trim additional spaces that are entered by the user strName = txtName.Text.Trim lblReservation.Text = ""
If ddlNights.SelectedIndex.Equals(0) Then lblNIghtsError.Visible = True Else lblNIghtsError.Visible = False If cldDates.SelectedDate
' This will show the Calendar error if valid date not selected. If cldDates.SelectedDate
' Calculate the cost of the room
End Sub Protected Sub radCity_SelectedIndexChanged(sender As Object, e As EventArgs) Handles radCity.SelectedIndexChanged
End Sub Protected Sub cldDates_SelectionChanged(sender As Object, e As EventArgs) Handles cldDates.SelectionChanged
End Sub Protected Sub ddlNights_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlNights.SelectedIndexChanged
End Sub Protected Sub txtName_TextChanged(sender As Object, e As EventArgs) Handles txtName.TextChanged
End Sub End Class

Response:
I am trying to achieve the below screenshot for when I hit the submit button on my webform. It will take and calculate the room selected from one of the 3 radio buttons x the number of nights select. The number of nights can be between 1 to 10 nights. It would then take that information and add it to my web form for under the label lblReservation that is on the screenshot above.. Hopefully that makes sense.

Listitem Collection Editor Enter Name RadioButtonList Tasks Choose Data Source... Edit Items... asp:RadioButtonL Edinburgh ($17 a night) Members: Edinburgh (S17 a night) properties: Edinburgh ($17 a night) 1 Florence ($23 value) 2 Barcelona ($19 a night) C Florence ($23 value) v Misc Barcelona ($19 a night) Enable AutoPostBack Enabled Selected Text Value True False Edinburgh ($17 a night) 17 Select Night January 2018 Submit 31 1 23 4 56 * Select a valid Date 7 8910 12 13 IblReservation] 14 15 16 17 18 19 20
Step by Step Solution
There are 3 Steps involved in it
To calculate the cost based on the selected city and number of nights youll need to update the btnSubmitClick method to get the selected values and pe... View full answer
Get step-by-step solutions from verified subject matter experts
