در قسمت 9 ویدیو یاد داده شد که چگونه دو تا ایتم به سبد خرید اضافه کنیم با این کد ها

  protected void AddToShoppingCart_Click(object sender, EventArgs e)
 
{

Button btn = (Button)sender;
if (Session["shoppingCart"]!= null)
{
Session["shoppingCart"] += "," + btn.ToolTip;
}
else
{
Session.Add("shoppingCart", btn.ToolTip);

}

// Response.Redirect("shoppingCart.aspx");
}


و این کد
protected void Page_Load(object sender, EventArgs e) { if (Session["status"] != null && Session["status"].ToString() == "Login") { //successful login sql_addedProds.SelectCommand = "SELECT * FROM [Products] WHERE ([id] in (" + Session["shoppingCart"].ToString() + "))"; } else { Response.Redirect("login.aspx"); } }
ولی وقتی دو ایتم یه سبد اضافه می کنم این ارور را می دهد
Server Error in '/' Application.
Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: Input string was not in a correct format.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[FormatException: Input string was not in a correct format.]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +14286670
System.Number.ParseInt32(String s, Num
{
if (Session["status"] != null &&
Session["status"].ToString() == "Login")
{


//successful login
sql_addedProds.SelectCommand = "SELECT * FROM [Products] WHERE ([id] in ("
+ Session["shoppingCart"].ToString() + "))";


}
else
{
Response.Redirect("login.aspx");
}




جدیدترین سوالات

در قسمت 9 ویدیو یاد داده شد که چگونه دو تا ایتم به سبد خرید اضافه کنیم با این کد ها

  protected void AddToShoppingCart_Click(object sender, EventArgs e)
 
{

Button btn = (Button)sender;
if (Session["shoppingCart"]!= null)
{
Session["shoppingCart"] += "," + btn.ToolTip;
}
else
{
Session.Add("shoppingCart", btn.ToolTip);

}

// Response.Redirect("shoppingCart.aspx");
}


و این کد
protected void Page_Load(object sender, EventArgs e) { if (Session["status"] != null && Session["status"].ToString() == "Login") { //successful login sql_addedProds.SelectCommand = "SELECT * FROM [Products] WHERE ([id] in (" + Session["shoppingCart"].ToString() + "))"; } else { Response.Redirect("login.aspx"); } }
ولی وقتی دو ایتم یه سبد اضافه می کنم این ارور را می دهد
Server Error in '/' Application.
Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: Input string was not in a correct format.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[FormatException: Input string was not in a correct format.]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +14286670
System.Number.ParseInt32(String s, Num
{
if (Session["status"] != null &&
Session["status"].ToString() == "Login")
{


//successful login
sql_addedProds.SelectCommand = "SELECT * FROM [Products] WHERE ([id] in ("
+ Session["shoppingCart"].ToString() + "))";


}
else
{
Response.Redirect("login.aspx");
}




جستجو در بانک سوالات
در این قسمت می توانید بخشی از متن سوال را وارد نموده و به دنبال سوال مورد نظر خود بگردید:

بخشی از متن سوال:

قالب وبلاگ

0
امتیاز

جواب های موجود برای این سوال:


ازین پس می توانید به کاربرانی که دوست دارید هدیه بدهید! کافیست بر روی علامت    در کنار تصویر آنها کلیک کنید!

1


جواب برای این سوال ثبت شده است!

تازه ترین


جواب ها رو اول نشون بده

پرامتیاز ترین


جواب ها رو اول نشون بده

1 جواب برای این سوال ثبت شده!

چینش بر اساس زمان ثبت


چینش بر اساس امتیاز



18696
9815
64014

Guest

0
امتیاز




جواب تو چیه؟
userImage
کاربر میهمان
     
























پرسش سوال جدید :: تبلیغات در سوال و جواب :: گروه های سوال و جوابی

تمامی حقوق مادی و معنوی، متعلق به وب سایت سوال جواب (soja.ai) و تیم مدیریتی آن می باشد.

طراحی و اجرا : گروه مشاوران فناوری اطلاعات

پاسخ های موجود در سایت توسط کاربران سایت ثبت می شود،
سایت سوال و جواب هیچ مسئولیتی در قبال صحت و محتوی پاسخ ها ندارد، هرچند تا حد امکان نظارت بر محتوی آنها صورت می گیرد.