g-forcewebmedia
06-21-2006, 04:09 PM
Hello everyone i';ve been trying to solve this problem for the past 3 days now and im officially stumped. Basically is what is going on is that I'm teaching myself asp and im creating a little mock online oreder simulator...the login works fine, but when the summary apge comes up...a lot of the session variables are absent...:confused: ...how do i get these session variables to appear on the summary form like the rest of the already present ones...(*hint*: heres what I ahve found out already...the textboxes and drop down lists are not working, and it seems as if it has something to do with the way they are either orignally stated or are displayed..however no error mesage comes up so i'm not sure)
to view this problem first hand go here (http://www.bellamusicent.com/pizza/page1.aspx):
login name: *anything you want*
password: pizza
and for your convenience here is the code for the statement intiating the session for the number of pizzas (located on page2.aspx):
<script language="VB" runat="server">
private sub Page2Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Response.Redirect("page3.aspx")
Session("PizzaSmall") = txtPizzaSmallNum.Text
Session("PizzaMedium") = txtPizzaMediumNum.Text
Session("PizzaLarge") = txtPizzaLargeNum.Text
Session("PizzaExtra") = txtPizzaExtraNum.Text
Session("PizzaParty") = txtPizzaPartyNum.Text
end sub
Sub SmallSize(ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkPizzaSmall.Checked = true then
txtPizzaSmallNum.Visible = chkPizzaSmall.Checked
end if
if chkPizzaSmall.Checked = false then
txtPizzaSmallNum.Visible = false
end if
if chkPizzaSmall.Checked = true then
Session("PizzaSmallSum") = "yes"
Session("PizzaSmall") = txtPizzaSmallNum.Text
end if
End Sub
Sub MediumSize(ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkPizzaMedium.Checked = true then
txtPizzaMediumNum.Visible = chkPizzaMedium.Checked
end if
if chkPizzaMedium.Checked = false then
txtPizzaMediumNum.Visible = false
end if
if chkPizzaMedium.Checked = true then
Session("PizzaMediumSum") = "yes"
Session("PizzaMedium") = txtPizzaMediumNum.Text
end if
End Sub
Sub LargeSize(ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkPizzaLarge.Checked = true then
txtPizzaLargeNum.Visible = chkPizzaLarge.Checked
end if
if chkPizzaLarge.Checked = false then
txtPizzaLargeNum.Visible = false
end if
if chkPizzaLarge.Checked = true then
Session("PizzaLargeSum") = "yes"
Session("PizzaLarge") = txtPizzaLargeNum.Text
end if
End Sub
Sub ExtraSize(ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkPizzaExtra.Checked = true then
txtPizzaExtraNum.Visible = chkPizzaExtra.Checked
end if
if chkPizzaExtra.Checked = false then
txtPizzaExtraNum.Visible = false
end if
if chkPizzaExtra.Checked = true then
Session("PizzaExtraSum") = "yes"
Session("PizzaExtra") = txtPizzaExtraNum.Text
end if
End Sub
Sub PartySize(ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkPizzaParty.Checked = true then
txtPizzaPartyNum.Visible = chkPizzaParty.Checked
end if
if chkPizzaParty.Checked = false then
txtPizzaPartyNum.Visible = false
end if
if chkPizzaParty.Checked = true then
Session("PizzaPartySum") = "yes"
Session("PizzaParty") = txtPizzaPartyNum.Text
end if
End Sub
Sub TopPepperoni (ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkToppingPepperoni.Checked = true then
Session("ToppingPepperoni")= "yes"
end if
End sub
Sub TopMushrooms (ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkToppingMushrooms.Checked = true then
Session("ToppingMushrooms")= "yes"
end if
End sub
Sub TopOnions (ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkToppingOnions.Checked = true then
Session("ToppingOnions")= "yes"
end if
End sub
Sub TopGP (ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkToppingGP.Checked = true then
Session("ToppingGP")= "yes"
end if
End sub
Sub TopBacon (ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkToppingBacon.Checked = true then
Session("ToppingBacon")= "yes"
end if
End sub
Sub TopPineapple (ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkToppingPineapple.Checked = true then
Session("ToppingPineapple")= "yes"
end if
End sub
</script>
and here is the statement for displaying it (located on final.aspx):
Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
if Session("PizzaSmallSum") = "yes" then
lblPizzaSmall.Visible = true
lblPizzaSmall.Text = lblPizzaSmall.Text & " Small pizza(s) <br/>"
end if
if Session("PizzaMediumSum") = "yes" then
lblPizzaMedium.Visible = true
lblPizzaMedium.Text = lblPizzaMedium.Text & " Medium pizza(s) <br/>"
end if
if Session("PizzaLargeSum") = "yes" then
lblPizzaLarge.Visible = true
lblPizzaLarge.Text = lblPizzaLarge.Text & " Large pizza(s) <br/>"
end if
if Session("PizzaExtraSum") = "yes" then
lblPizzaExtra.Visible = true
lblPizzaExtra.Text = lblPizzaExtra.Text & " Extra pizza(s) <br/>"
end if
if Session("PizzaPartySum") = "yes" then
lblPizzaParty.Visible = true
lblPizzaParty.Text = lblPizzaParty.Text & " Party pizza(s) <br/>"
end if
if Session("ToppingPepperoni")= "yes" then
lblPepperoni.Visible = true
lblPepperoni.Text = "Pepperoni <br/>"
end if
if Session("ToppingMushrooms")= "yes" then
lblMushrooms.Visible = true
lblMushrooms.Text = "Mushrooms <br/>"
end if
if Session("ToppingOnions")= "yes" then
lblOnions.Visible = true
lblOnions.Text = "Onions <br/>"
end if
if Session("ToppingGP")= "yes" then
lblGP.Visible = true
lblGP.Text = "Green Peppers <br/>"
end if
if Session("ToppingBacon")= "yes" then
lblBacon.Visible = true
lblBacon.Text = "Bacon <br/>"
end if
if Session("ToppingPineapple")= "yes" then
lblPineapple.Visible = true
lblPineapple.Text = "Pineapple <br/>"
end if
if Session("WingsSum") = "yes" then
lblWings.Visible = true
lblWings.Text = lblWings.Text & "wings <br/>"
end if
if Session("Garlic")= "yes" then
lblGarlic.Visible = true
lblGarlic.Text = "Garlic Bread <br/>"
end if
if Session("Cheese")= "yes" then
lblCheese.Visible = true
lblCheese.Text = "Cheese Sticks <br/>"
end if
if Session("Ceasar")= "yes" then
lblCeasar.Visible = true
lblCeasar.Text = "Ceasar Salad <br/>"
end if
if Session("Calzone")= "yes" then
lblCalzone.Visible = true
lblCalzone.Text = "Calzone <br/>"
end if
if Session("Jerk")= "yes" then
lblJerk.Visible = true
lblJerk.Text = "Jerk Chicken <br/>"
end if
if Session("SodaSum") = "yes" then
lblSoda.Visible = true
lblSoda.Text = lblSoda.Text & "<br/>"
end if
if Session("Fruitopia")= "yes" then
lblFruitopia.Visible = true
lblFruitopia.Text = "Fruitopia <br/>"
end if
if Session("IceTea")= "yes" then
lblIceTea.Visible = true
lblIceTea.Text = "Ice Tea <br/>"
end if
if Session("Shake")= "yes" then
lblShake.Visible = true
lblShake.Text = "Milk Shake <br/>"
end if
if Session("Coocnut")= "yes" then
lblCoconut.Visible = true
lblCoconut.Text = "Coconut Water <br/>"
end if
if Session("PickUpSum") = "yes" then
lblOrderType.Text = "Order Type: Pick up"
lblFirstNamePU.Visible = true
lblFirstNamePU.Text = lblFirstNamePU.Text
lblLastNamePU.Visible = true
lblLastNamePU.Text = lblLastNamePU.Text & "<br/>"
lblPhoneNumber1PU.Visible = true
lblPhoneNumber1PU.Text = "(" & lblPhoneNumber1PU.Text & ")"
lblPhoneNumber2PU.Visible = true
lblPhoneNumber2PU.Text = lblPhoneNumber2PU.Text & "-"
lblPhoneNumber3PU.Visible = true
lblPhoneNumber3PU.Text = lblPhoneNumber3PU.Text & "<br/>"
end if
if Session("DeliverySum") = "yes" then
lblOrderType.Text = "Order Type: " & lblOrderType.Text
lblFirstNameDEV.Visible = true
lblFirstNameDEV.Text = lblFirstNameDEV.Text & "<br/>"
lblLastNameDEV.Visible = true
lblLastNameDEV.Text = lblLastNameDEV.Text & "<br/>"
lblAddressDEV.Visible = true
lblAddressDEV.Text = lblAddressDEV.Text & "<br/>"
lblCityDEV.Visible = true
lblCityDEV.Text = lblCityDEV.Text & "<br/>"
lblPostalDEV.Visible = true
lblPostalDEV.Text = lblPostalDEV.Text & "<br/>"
lblPhoneNumber1DEV.Visible = true
lblPhoneNumber1DEV.Text = "(" & lblPhoneNumber1DEV.Text & ")"
lblPhoneNumber2DEV.Visible = true
lblPhoneNumber2DEV.Text = lblPhoneNumber2DEV.Text & "-"
lblPhoneNumber3DEV.Visible = true
lblPhoneNumber3DEV.Text = lblPhoneNumber3DEV.Text & "<br/>"
end if
End Sub
</script>
to view this problem first hand go here (http://www.bellamusicent.com/pizza/page1.aspx):
login name: *anything you want*
password: pizza
and for your convenience here is the code for the statement intiating the session for the number of pizzas (located on page2.aspx):
<script language="VB" runat="server">
private sub Page2Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Response.Redirect("page3.aspx")
Session("PizzaSmall") = txtPizzaSmallNum.Text
Session("PizzaMedium") = txtPizzaMediumNum.Text
Session("PizzaLarge") = txtPizzaLargeNum.Text
Session("PizzaExtra") = txtPizzaExtraNum.Text
Session("PizzaParty") = txtPizzaPartyNum.Text
end sub
Sub SmallSize(ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkPizzaSmall.Checked = true then
txtPizzaSmallNum.Visible = chkPizzaSmall.Checked
end if
if chkPizzaSmall.Checked = false then
txtPizzaSmallNum.Visible = false
end if
if chkPizzaSmall.Checked = true then
Session("PizzaSmallSum") = "yes"
Session("PizzaSmall") = txtPizzaSmallNum.Text
end if
End Sub
Sub MediumSize(ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkPizzaMedium.Checked = true then
txtPizzaMediumNum.Visible = chkPizzaMedium.Checked
end if
if chkPizzaMedium.Checked = false then
txtPizzaMediumNum.Visible = false
end if
if chkPizzaMedium.Checked = true then
Session("PizzaMediumSum") = "yes"
Session("PizzaMedium") = txtPizzaMediumNum.Text
end if
End Sub
Sub LargeSize(ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkPizzaLarge.Checked = true then
txtPizzaLargeNum.Visible = chkPizzaLarge.Checked
end if
if chkPizzaLarge.Checked = false then
txtPizzaLargeNum.Visible = false
end if
if chkPizzaLarge.Checked = true then
Session("PizzaLargeSum") = "yes"
Session("PizzaLarge") = txtPizzaLargeNum.Text
end if
End Sub
Sub ExtraSize(ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkPizzaExtra.Checked = true then
txtPizzaExtraNum.Visible = chkPizzaExtra.Checked
end if
if chkPizzaExtra.Checked = false then
txtPizzaExtraNum.Visible = false
end if
if chkPizzaExtra.Checked = true then
Session("PizzaExtraSum") = "yes"
Session("PizzaExtra") = txtPizzaExtraNum.Text
end if
End Sub
Sub PartySize(ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkPizzaParty.Checked = true then
txtPizzaPartyNum.Visible = chkPizzaParty.Checked
end if
if chkPizzaParty.Checked = false then
txtPizzaPartyNum.Visible = false
end if
if chkPizzaParty.Checked = true then
Session("PizzaPartySum") = "yes"
Session("PizzaParty") = txtPizzaPartyNum.Text
end if
End Sub
Sub TopPepperoni (ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkToppingPepperoni.Checked = true then
Session("ToppingPepperoni")= "yes"
end if
End sub
Sub TopMushrooms (ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkToppingMushrooms.Checked = true then
Session("ToppingMushrooms")= "yes"
end if
End sub
Sub TopOnions (ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkToppingOnions.Checked = true then
Session("ToppingOnions")= "yes"
end if
End sub
Sub TopGP (ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkToppingGP.Checked = true then
Session("ToppingGP")= "yes"
end if
End sub
Sub TopBacon (ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkToppingBacon.Checked = true then
Session("ToppingBacon")= "yes"
end if
End sub
Sub TopPineapple (ByVal sender As System.Object, ByVal e As System.EventArgs)
if chkToppingPineapple.Checked = true then
Session("ToppingPineapple")= "yes"
end if
End sub
</script>
and here is the statement for displaying it (located on final.aspx):
Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
if Session("PizzaSmallSum") = "yes" then
lblPizzaSmall.Visible = true
lblPizzaSmall.Text = lblPizzaSmall.Text & " Small pizza(s) <br/>"
end if
if Session("PizzaMediumSum") = "yes" then
lblPizzaMedium.Visible = true
lblPizzaMedium.Text = lblPizzaMedium.Text & " Medium pizza(s) <br/>"
end if
if Session("PizzaLargeSum") = "yes" then
lblPizzaLarge.Visible = true
lblPizzaLarge.Text = lblPizzaLarge.Text & " Large pizza(s) <br/>"
end if
if Session("PizzaExtraSum") = "yes" then
lblPizzaExtra.Visible = true
lblPizzaExtra.Text = lblPizzaExtra.Text & " Extra pizza(s) <br/>"
end if
if Session("PizzaPartySum") = "yes" then
lblPizzaParty.Visible = true
lblPizzaParty.Text = lblPizzaParty.Text & " Party pizza(s) <br/>"
end if
if Session("ToppingPepperoni")= "yes" then
lblPepperoni.Visible = true
lblPepperoni.Text = "Pepperoni <br/>"
end if
if Session("ToppingMushrooms")= "yes" then
lblMushrooms.Visible = true
lblMushrooms.Text = "Mushrooms <br/>"
end if
if Session("ToppingOnions")= "yes" then
lblOnions.Visible = true
lblOnions.Text = "Onions <br/>"
end if
if Session("ToppingGP")= "yes" then
lblGP.Visible = true
lblGP.Text = "Green Peppers <br/>"
end if
if Session("ToppingBacon")= "yes" then
lblBacon.Visible = true
lblBacon.Text = "Bacon <br/>"
end if
if Session("ToppingPineapple")= "yes" then
lblPineapple.Visible = true
lblPineapple.Text = "Pineapple <br/>"
end if
if Session("WingsSum") = "yes" then
lblWings.Visible = true
lblWings.Text = lblWings.Text & "wings <br/>"
end if
if Session("Garlic")= "yes" then
lblGarlic.Visible = true
lblGarlic.Text = "Garlic Bread <br/>"
end if
if Session("Cheese")= "yes" then
lblCheese.Visible = true
lblCheese.Text = "Cheese Sticks <br/>"
end if
if Session("Ceasar")= "yes" then
lblCeasar.Visible = true
lblCeasar.Text = "Ceasar Salad <br/>"
end if
if Session("Calzone")= "yes" then
lblCalzone.Visible = true
lblCalzone.Text = "Calzone <br/>"
end if
if Session("Jerk")= "yes" then
lblJerk.Visible = true
lblJerk.Text = "Jerk Chicken <br/>"
end if
if Session("SodaSum") = "yes" then
lblSoda.Visible = true
lblSoda.Text = lblSoda.Text & "<br/>"
end if
if Session("Fruitopia")= "yes" then
lblFruitopia.Visible = true
lblFruitopia.Text = "Fruitopia <br/>"
end if
if Session("IceTea")= "yes" then
lblIceTea.Visible = true
lblIceTea.Text = "Ice Tea <br/>"
end if
if Session("Shake")= "yes" then
lblShake.Visible = true
lblShake.Text = "Milk Shake <br/>"
end if
if Session("Coocnut")= "yes" then
lblCoconut.Visible = true
lblCoconut.Text = "Coconut Water <br/>"
end if
if Session("PickUpSum") = "yes" then
lblOrderType.Text = "Order Type: Pick up"
lblFirstNamePU.Visible = true
lblFirstNamePU.Text = lblFirstNamePU.Text
lblLastNamePU.Visible = true
lblLastNamePU.Text = lblLastNamePU.Text & "<br/>"
lblPhoneNumber1PU.Visible = true
lblPhoneNumber1PU.Text = "(" & lblPhoneNumber1PU.Text & ")"
lblPhoneNumber2PU.Visible = true
lblPhoneNumber2PU.Text = lblPhoneNumber2PU.Text & "-"
lblPhoneNumber3PU.Visible = true
lblPhoneNumber3PU.Text = lblPhoneNumber3PU.Text & "<br/>"
end if
if Session("DeliverySum") = "yes" then
lblOrderType.Text = "Order Type: " & lblOrderType.Text
lblFirstNameDEV.Visible = true
lblFirstNameDEV.Text = lblFirstNameDEV.Text & "<br/>"
lblLastNameDEV.Visible = true
lblLastNameDEV.Text = lblLastNameDEV.Text & "<br/>"
lblAddressDEV.Visible = true
lblAddressDEV.Text = lblAddressDEV.Text & "<br/>"
lblCityDEV.Visible = true
lblCityDEV.Text = lblCityDEV.Text & "<br/>"
lblPostalDEV.Visible = true
lblPostalDEV.Text = lblPostalDEV.Text & "<br/>"
lblPhoneNumber1DEV.Visible = true
lblPhoneNumber1DEV.Text = "(" & lblPhoneNumber1DEV.Text & ")"
lblPhoneNumber2DEV.Visible = true
lblPhoneNumber2DEV.Text = lblPhoneNumber2DEV.Text & "-"
lblPhoneNumber3DEV.Visible = true
lblPhoneNumber3DEV.Text = lblPhoneNumber3DEV.Text & "<br/>"
end if
End Sub
</script>