c# - Displaying Integer in a Label -
how can display integer in label? doing calculating total , trying display in label.
public partial class total : system.web.ui.page { int total; protected void page_load(object sender, eventargs e) { label1.text = server.htmlencode(request.cookies["confirm"]["quantity"]); int quantity = (int)session["textbox1value"]; if (request.cookies["user"]["items"] == "tyres") { total = 20 * quantity; label2.text = ??? } } } or there other way display total on same page?
use
label2.text = total.tostring(); or
label2.text = convert.tostring(total); since text takes string have convert total integer value string calling tostring() or convert.tostring(int).
Comments
Post a Comment