의 사용자 코드에 의해 처리되지 않았습니다. 오류 메시지가 계속 나타납니다. 또한, 코드를 실행할 때 전혀 작동하지 않는 것 같습니다. 다른 페이지로 데이터를 전달하려고합니다. 어떠한 제안? 이 형식 코드가 C#
public partial class _Default : System.Web.UI.Page
{
static int numBeachBookingInt = 0;
static int numBushBookingInt = 0;
static decimal totRevenue = 0;
protected void Page_Load(object sender, EventArgs e)
{
string totalRevenue;
if (Convert.ToString(Session["confirmBooking"]) == "confirm" && Convert.ToString(Session["bachType"]) == "bush")
{
totalRevenue = (string)(Session["totalRevenue"]);
totRevenue += decimal.Parse(totalRevenue);
totRevenueLabel.Text = String.Format("{0:c}", totRevenue);
numBushBooking += 1;
numBushHouseLabel.Text = numBushBooking.ToString();
Session["confirmBooking"] = "no current booking";
Session["bachType"] = "none";
}
else if (Convert.ToString(Session["confirmBooking"]) == "confirm" && Convert.ToString(Session["bachType"]) == "beach")
{
totalRevenue = (string)(Session["totalRevenue"]);
totRevenue += decimal.Parse(totalRevenue);
totRevenueLabel.Text = String.Format("{0:c}", totRevenue);
numBeachBooking += 1;
numBeachHouseLabel.Text = numBeachBooking.ToString();
Session["confirmBooking"] = "no current booking";
Session["bachType"] = "none";
}
numBeachHouseLabel.Text = numBeachBooking.ToString();
numBushHouseLabel.Text = numBushBooking.ToString();
이
번째이며, 메인 페이지의 코드이다.protected void confirmButton_Click(object sender, EventArgs e)
{
Session["confirmBooking"] = "confirm";
Session["totalRevenue"] = totalRateLabel.Text;
switch (bachTypeRadioButtonList.Text)
{
case "Beach":
Session["bachType"] = "beach";
break;
case "Bush":
Session["bachType"] = "bush";
break;
default:
Session["bachType"] = "none";
break;
}
Response.Redirect("MainBookingForm.aspx");
}
디버거에서 실행할 때 예외를 볼 수없는 경우 일부 catch try 문을 넣으십시오. @musical_coder 제안은 시작하기 좋은 곳입니다. – miltonb